specify alphanumeric/numeric data for import

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

minijim
Posts: 14
Joined: Sun Dec 20, 2009 10:01 am

specify alphanumeric/numeric data for import

Postby minijim » Wed Apr 07, 2010 1:26 pm

Hi,
I have a problem when I try to import a text file in EViews :

Code: Select all

wfopen(type=text) "data.txt" delim=tab na="NULL" names=("num1","num2","alpha1","alpha2","alpha3","pikachu","num4")

(In fact there are 110 series in my text file);
pikachu contains numerical data (with some missing values), but EViews creates a alphanumerical series for this column.

I saw in EViews Command Reference that the option rformat seems to allow the specification of strings or numbers in the series, but I do not manage to use it : I tried
rformat=(pikachu# 9),
rformat=("pikachu"# 9),
rformat=(num1 1 num2 2 alpha1 3 alpha2 4 alpha3 5 pikachu# 6 num4 7)
but the error message
Syntax error: unexpected character '(' in rformat specification in "wfopen(type=text) "data.txt" delim=tab rformat=(pikachu# 9) na="NULL" names=("num1","num2","alpha1","alpha2","alpha3","pikachu","num4")

appears at each execution.

Is there a way to specify in this command that pikachu is a numerical series ?
(I know I could convert the alpha series in a numerical one using

Code: Select all

series pikachu2=@val(pikachu)
but there is probably an easier and neater way to do it ?)

Thanks in advance

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

Re: specify alphanumeric/numeric data for import

Postby EViews Gareth » Wed Apr 07, 2010 1:37 pm

I would guess it would be :

Code: Select all

rformat=(num1 1 num2 2 alpha1 3 alpha2 4 alpha3 5 #pikachu 6 num4 7)


but I haven't tested it (and nor do I believe I have ever used the rformat thing before). If it doesn't work, post a snippet of your data, and I'll play around.
Follow us on Twitter @IHSEViews

minijim
Posts: 14
Joined: Sun Dec 20, 2009 10:01 am

Re: specify alphanumeric/numeric data for import

Postby minijim » Thu Apr 08, 2010 1:19 am

Thanks for your help; unfortunately it still does not work with #pikachu .
Here is an extract from my .txt file :
data.doc
(1.63 MiB) Downloaded 182 times
(it is not a .doc, but the extension .txt seems to not be allowed for attachments; you need to modify it in data.txt)

The "pikachu" column is the column 9, the other columns are well identified by EViews as numerical or alpha series.

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

Re: specify alphanumeric/numeric data for import

Postby EViews Gareth » Thu Apr 08, 2010 8:09 am

Rather than messing around with the rformat, just add "scan=all" to the end of your open line. So something like this:

wfopen(type=text) "data.txt" delim=tab na="NULL" names=("num1","num2","alpha1","alpha2","alpha3","pikachu","num4") scan=all

I think that will work for you.

I'm guessing you're using EViews 6? EViews 7 correctly recognised the 9th column for me.
Follow us on Twitter @IHSEViews

minijim
Posts: 14
Joined: Sun Dec 20, 2009 10:01 am

Re: specify alphanumeric/numeric data for import

Postby minijim » Thu Apr 08, 2010 9:09 am

Thanks a lot Gareth, it works with scan=all (on EViews 6 indeed)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 25 guests