Hi All,
I am still using EViews 8.1 and I have this question I don't seem to have a way to solve.
I wrote a program that sucks in csv files (panel datasets with date id and cross id columns) into eviews, convert them into dated panel using pagestruct, but before I could do anything, I found out that the supposedly string cross id column has been converted into series by Eviews.
I understand that it's because I have a mixture of double quoted numerics and characters, and the latter don't appear until the end of the dataset.
I read the wfopen help page carefully, and saw that there is a quotes=double for html files, but I can't seem to make it work for csv's. The other way I see is to predefine the column type (using format=(A3), for instance), but I have csv files with different number of columns (more than 50+ files) and I can't predefine them all before I imported them.
Is there a way to solve this?
Thanks.
Tchaithonov
WFOPEN function on CSV file changes column data type
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: WFOPEN function on CSV file changes column data type
You can try using the scan=all argument.
Follow us on Twitter @IHSEViews
-
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
Re: WFOPEN function on CSV file changes column data type
Hi Gareth,
Thanks for the suggestion, but it doesn't seem to work.
I tried this:
it seems gives me a series for that column with NAs replacing all the characters.
Am I doing anything wrong with that code? Please let me know. Thanks.
Philip
Thanks for the suggestion, but it doesn't seem to work.
I tried this:
Code: Select all
wfopen(scan=all) {%file}
it seems gives me a series for that column with NAs replacing all the characters.
Am I doing anything wrong with that code? Please let me know. Thanks.
Philip
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: WFOPEN function on CSV file changes column data type
Follow us on Twitter @IHSEViews
-
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
Re: WFOPEN function on CSV file changes column data type
Yeah, I actually tried both ways
Not working.
Code: Select all
wfopen(scan=all) {%file} ' which I showed above
wfopen {%file} scan=all
Not working.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13307
- Joined: Tue Sep 16, 2008 5:38 pm
Re: WFOPEN function on CSV file changes column data type
We'd need to see the file.
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 19 guests