Hello,
I have several tsv (tab-separated) files with data that has notes, for example a tab separated field can have a value of "125 a" and another field is "127". When I wfopen the file sometimes the series with notes are read as alphas and sometimes as series with the annotated fields read as NAs. I would like to force Eviews to read all the file as a set of alphas which then I will clean (remove the note indicators) and transform back into series. I can't figure out the syntax for this, could you please help?
The actual files I am actually working with are those of the Eurostat database that can be found in here:
http://epp.eurostat.ec.europa.eu/NavTre ... 1&dir=data
Thanks,
Javier
Open file with forced alphas
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Open file with forced alphas
Any column that has an alpha character in it will be opened as an Alpha. There is a possible explanation for what is happening though.
When opening a file, EViews doesn't scan every row to decide whether something is an Alpha or a Series. Rather it does the first X rows (can't remember exactly how many), since reading every row just to decide whether it is an Alpha or not is time consuming. If a column doesn't have any characters (i.e. there are no annotated rows) in the first X rows, EViews will assume that that column is a Series. You can force it to scan every row with the scan=all option.
When opening a file, EViews doesn't scan every row to decide whether something is an Alpha or a Series. Rather it does the first X rows (can't remember exactly how many), since reading every row just to decide whether it is an Alpha or not is time consuming. If a column doesn't have any characters (i.e. there are no annotated rows) in the first X rows, EViews will assume that that column is a Series. You can force it to scan every row with the scan=all option.
Re: Open file with forced alphas
Thanks Gareth, I'll try that.
Re: Open file with forced alphas
Unfortunately it doesn't seem to work like that for me.
Take for example the .tsv file zipped in here
http://epp.eurostat.ec.europa.eu/NavTre ... p_k.tsv.gz
it is 10mb when unzipped so too large for attachment. It is better if you can open it in Excel for following up the data I refer to.
For example the elements corresponding to "NSA,EUR_HAB_CLV00,B1G,SI" in row 24 for 2010q2, 2010q1,...,2008q1 are a mix of numbers and letters but Eviews will read each column as a series and replace the cells with annotations with NAs.
There are two ways I think I can read this file:
where all the data is read as series (I lose the alpha with the dates)
or
where the data is read transposed, I keep the date alphas but again I lose all the series that have notes.
So, is there a way of reading every single column/row of the .tsv file as alphas?
Thanks,
Javier
Take for example the .tsv file zipped in here
http://epp.eurostat.ec.europa.eu/NavTre ... p_k.tsv.gz
it is 10mb when unzipped so too large for attachment. It is better if you can open it in Excel for following up the data I refer to.
For example the elements corresponding to "NSA,EUR_HAB_CLV00,B1G,SI" in row 24 for 2010q2, 2010q1,...,2008q1 are a mix of numbers and letters but Eviews will read each column as a series and replace the cells with annotations with NAs.
There are two ways I think I can read this file:
Code: Select all
workfile(wf=Test) u 243
read(t,t=txt,d=t) namq_gdp_k.tsv 9789or
Code: Select all
wfopen namq_gdp_k.tsv scan=allSo, is there a way of reading every single column/row of the .tsv file as alphas?
Thanks,
Javier
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Open file with forced alphas
ok, we'll do it the proper way :D
where format=252A tells EViews that you have 242 columns that you want to treat as Alphas. You could do something like format=(230A, 2F, 10A) which says that you have 230 columns to treats as Alphas, followed by 2 to be treated as Series, then 10 more Alphas.
On a separate note, you could actually tell EViews to ignore the annotations by indicating that "b" is a delimiter:
Code: Select all
wfopen namq_gdp_k.tsv colhead=1 format=(242A)
On a separate note, you could actually tell EViews to ignore the annotations by indicating that "b" is a delimiter:
Code: Select all
wfopen namq_gdp_k.tsv colhead=1 custom="b" delim=white mult=on
Re: Open file with forced alphas
I knew it had to be possible! That's brilliant, thanks very much Gareth.
Re: Open file with forced alphas
Actually, the second method does not work well when the annotation has two characters (like "127 be" in say 2010q2). When doing
the 127 will be stored in 2010q3.
The othermethod works fine.
Thanks,
Javier
Code: Select all
wfopen namq_gdp_k.tsv colhead=1 custom="b" delim=white mult=onThe othermethod works fine.
Thanks,
Javier
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Open file with forced alphas
you could change custom to be "b, e", I think.
Who is online
Users browsing this forum: No registered users and 2 guests
