how to import a non-data text file?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

how to import a non-data text file?

Postby Liu » Mon Sep 30, 2013 9:17 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Mon Sep 30, 2013 9:31 am

Use a text object, then text.append to read in the text file.

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

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

Postby Liu » Mon Sep 30, 2013 11:49 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Mon Sep 30, 2013 12:09 pm

No, that's a string object. Use a text object.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests