How to get all content from a document ? or How to get all lines from a document in datamapper field extract ?

In the Datamapper, I want to get all content from a record from a txt file. the number of lines of the record is not the same for each record. JS Script answer would be appreciated. Any help ?

in the doc : Extracting data of variable length,

I could not find any example.

I need to do something as a file_get_content in PHP. I would like to do : record.myField = data.extract((all);

No need for JavaScript: create a new Extract Field and specify 0 as the height for the selection. This instructs the DataMapper to extract from the current location until the end of the record.

The option is documented in this online help page.

And if you still want to use JavaScript, you simply specify 0 as the height parameter for the Extract() method, for example:

data.extract(1,81,14,0,"<br />");