importing from mixed numerical and alpha files
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
importing from mixed numerical and alpha files
I am having trouble importing tab delimited files either in .txt or .xls formats. The data has 25 columns with no headers. Some columns are alpha and some numeric. There must be some simple command lines to do this but the user's guide doesn't have much on alpha data.
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: importing from mixed numerical and alpha files
From the Command Reference entry for read:
To import data into alpha series, you must specify the names of your series, and should enter the tag "$" following the series name (e.g., "NAME $ INCOME CONSUMP").
Re: importing from mixed numerical and alpha files
I am working through the GUI. I have a work file set up as "series alpha." When I use the ACII Text Import on the text file data and insert NAME $ x1 x2 etc. it imports everything in NA. When I use the proc excel spreadsheet import on the data in excel using that naming line it imports everything as series and so the alpha data is all NA.
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: importing from mixed numerical and alpha files
I'm not certain what's going on in your case, but my suggestion should work. I just tested a read of a file containing two rows:
Creating a new workfile using the "File/Open/Foreign Data as workfile" reads in three series (SERIES01, SERIES02, SERIES03), with the first and third series numeric and the second an alpha series.
Similarly, I can create a two observation workfile and use "Proc/Import/Read Text/Lotus/Excel...". I set the number of header lines to 0, and enter
"X Y $ Z" as the name string for the series, I obtain three series X Y and Z, where the first and third series are again numeric and the second is an alpha series.
1.2 <tab> abc <tab> 3.4
2.2 <tab> efg <tab> 5.5
Creating a new workfile using the "File/Open/Foreign Data as workfile" reads in three series (SERIES01, SERIES02, SERIES03), with the first and third series numeric and the second an alpha series.
Similarly, I can create a two observation workfile and use "Proc/Import/Read Text/Lotus/Excel...". I set the number of header lines to 0, and enter
"X Y $ Z" as the name string for the series, I obtain three series X Y and Z, where the first and third series are again numeric and the second is an alpha series.
Re: importing from mixed numerical and alpha files
The File/Open/Foreign Data as workfile works perfectly. Thanks!
The Proc/Import/Read Text-Lotus-Excel did not work. I must have the naming syntax wrong. I listed the names as:
x01 $ x02 x03 x04 x05 x06 x07 x08 x09m x10 x11 x12 x13 x14 x15 $ x16 $ x18 $ x19 $ x20 $ x21 $ x22 $ x23 $ x24 x25
The intention is to read x01 and x15-x23 as alpha and the rest numeric. What am I doing wrong?
The Proc/Import/Read Text-Lotus-Excel did not work. I must have the naming syntax wrong. I listed the names as:
x01 $ x02 x03 x04 x05 x06 x07 x08 x09m x10 x11 x12 x13 x14 x15 $ x16 $ x18 $ x19 $ x20 $ x21 $ x22 $ x23 $ x24 x25
The intention is to read x01 and x15-x23 as alpha and the rest numeric. What am I doing wrong?
-
- EViews Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: importing from mixed numerical and alpha files
That should be fine. I'm assuming that those series don't already exist in your workfile...
Who is online
Users browsing this forum: No registered users and 24 guests