Reading a csv file into a table

For questions regarding programming in the EViews programming language.

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

atoch
Posts: 15
Joined: Wed Dec 02, 2009 2:54 am
Location: Paris, France
Contact:

Reading a csv file into a table

Postby atoch » Tue Jul 05, 2011 4:28 am

Bonjour,

I have a table of metadata stored in a csv file. I'd like to be able to import it as an Eviews table. Is there a way to achieve that using an eviews program ? It is easy to export an Eviews Table into a text file but import does not seems to exist. May be there is a more appropriate Eviews object to store metadata ?

Thanks

Arnaud Atoch

CSV file content
Variable,Type,Power,Formula_Q,Formula_A,Flag
GDP,GROWTH,9,PGDP*GDPV,convert(averaged),I
CPV,GROWTH,9,ND,convert(averaged),F

Expected result in an Eviews Table
Variable Type Power Formula_Q Formula_A Flag
GDP Growth 9.000000 PGDP*GDPV Convert(averaged) I
CPV Growth 9.000000 ND Convert(averaged) F

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

Re: Reading a csv file into a table

Postby EViews Gareth » Tue Jul 05, 2011 7:51 am

There isn't an easy way to do this. In general, currently, EViews is not great at reading in meta data.

You have two options. You could either read the csv file in as a new page in your workfile, then figure out some way to get the information back to your original page.

Or you could read the csv file in as a text object, then parse the text object to get the metadata.

memos
Posts: 9
Joined: Tue Jun 03, 2014 7:32 am

Re: Reading a csv file into a table

Postby memos » Thu Jul 24, 2014 7:16 am

I was looking for an answer to the same question: "how to read text in a csv file into a table?"
However, regarding Gareth's second suggestion, I was not able to figure out how to read a text file into a text object. The text object does not seem to have a "read" procedure. I use Eviews version 8.

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

Re: Reading a csv file into a table

Postby EViews Gareth » Thu Jul 24, 2014 7:56 am

text.append

memos
Posts: 9
Joined: Tue Jun 03, 2014 7:32 am

Re: Reading a csv file into a table

Postby memos » Thu Jul 24, 2014 8:12 am

Thanks


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests