|
From: Ethan A M. <eam...@gm...> - 2018-11-14 05:20:45
|
On Tuesday, 13 November 2018 22:02:42 theozh wrote: > ok, I think here we go :-) > You concatenate the text '$Data <<EOD' and the content of the file using the commands 'echo' and 'type' at which the character '<' has to be escaped by '^'. > So easy if you know how. > > The advantages over the earlier mentioned other methods: > - empty lines are preserved > - no additional space character at the beginnig of the line > - no loading of any extra assistant files > > > ### Read file "as is" to datablock under Windows > reset session > FILE = "Test.dat" > > load "< echo $Data ^<^<EOD & type ".FILE > print "$Data" > print $Data > ### end of code Do you understand why the < characters need to be escaped? It seems worth documenting this technique somewhere and it would be nice to explain when this is or isn't necessary. Would it would to put in another set of quotes instead? load "< echo '$Data <<EOD' & type ".FILE Glad you got it working. Ethan |