Indeed, @wread comes close to what I have in mind.
Unfortunately, however, @wread seems to be buggy - at least in version Eviews 10 March 2018 build, which renders this command largely inappropriate for my purposes:
1) @wread encloses lines in quotes which is not wanted, and it does so inconsistently. See example below: lines read from text1.txt are enclosed in double quotes, not so lines read from text2.txt. The double quotes cannot be easily removed by @replace, for instance, because this would also remove those double quotes which have been inserted on purpose in the text file to be read in.
2) @wread seems to skip lines with one single character at the beginning of a row. See text2.txt in the example below
I have not been aware of @wread since, at least in Eviews 10 March 2018 build, it seems that @wread has not been documented in the off-line help of Eviews 10.
Best, mamo
Code: Select all
' @wread encloses lines in quotes which is not wanted
if @isobject("txt1") then
delete txt1
endif
' Generate a text file with some typical SQL code
text txt1
txt1.append Select VAR1 VAR2
txt1.append from MYDB
txt1.append where VAR1 IN (X)
txt1.save text1.txt
string str1 =@wread("text1.txt")
show str1
' @wread is buggy: it skips sinlge characters at the beginning of a line!
if @isobject("txt2") then
delete txt2
endif
text txt2
txt2.append H
txt2.append W
txt2.append Hello
txt2.append World
txt2.save text2.txt
string str2 =@wread("text2.txt")
show str2