Page 1 of 1
Reading CSV tables
Posted: Tue Mar 31, 2009 11:54 am
by javiersan
Hi,
I think this question was asked before but I cannot find the answer in the forum or help. Is there a way of reading a csv table into EViews but storing it as a table object in an existing workfile (not as a new workfile)?
Thanks,
Javier
Re: Reading CSV tables
Posted: Tue Mar 31, 2009 12:12 pm
by EViews Gareth
Unfortunately not, but I'll ask our Table Monkey to whip something up for EViews 7.
Re: Reading CSV tables
Posted: Tue Mar 31, 2009 3:59 pm
by javiersan
This should work, but I don't know how to obtain the number of obervations of an Alpha object (tried @obs and others to no effect).
I have assumed 23 observations:
Code: Select all
'----------------------------------------------------------------------------------------------------------
'Creates a table out of a .csv file
%tabfile="filename.csv"
wfopen %tabfile
group g series*
!c=g.@count
!r=23
table(!r,!c) ch_table
for !j=1 to !c
For !i=1 to !r
%ser="series"
If !j<10 then
%ser="series0"
endif
ch_table(!i,!j)={%ser}{!j}(!i)
next
next
delete series* g
Regards,
Javier
Re: Reading CSV tables
Posted: Tue Mar 31, 2009 4:10 pm
by EViews Gareth
try !r=@obsrange
Re: Reading CSV tables
Posted: Tue Mar 31, 2009 4:22 pm
by javiersan
Thanks, that's it.