Page 1 of 1

how to import a non-data text file?

Posted: Mon Sep 30, 2013 9:17 am
by Liu
Hi,

I want to import a .prg file, or a text file, and save it to a string. is there a way to do that?
later I might want to revise this string and save it back to the file.

for example, there is a .prg file path/p1.prg, in the file, the content is "Error message 1: ........, solution 1.......".
I want to import this information to a string:
wfcreate u 1900 2015
string m
read path/p1.prg
...


I tried many commands, read, pageload, none of them works.

Re: how to import a non-data text file?

Posted: Mon Sep 30, 2013 9:31 am
by EViews Gareth
Use a text object, then text.append to read in the text file.

Re: how to import a non-data text file?

Posted: Mon Sep 30, 2013 11:49 am
by Liu
when you say "use a text object" do you mean by this?

wfcreate m 1900 2013
string m
m.append C:\Users\Liu\Desktop\io.prg


It doesn't take the file as a text and import it.

Re: how to import a non-data text file?

Posted: Mon Sep 30, 2013 12:09 pm
by EViews Gareth
No, that's a string object. Use a text object.