Appending date ids - possible?
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Appending date ids - possible?
I want to write a programme to retrieve and append two excel files from the internet that have two different but consecutive date ids. Is it possible to append the two date ids to form a single date id? I can download the two files and combine them manually for the analysis but I want to avoid this if possible.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Appending date ids - possible?
You'll have to be more specific.
But in general, yes it is possible.
But in general, yes it is possible.
Follow us on Twitter @IHSEViews
Re: Appending date ids - possible?
HI
They're 2 files on the website of the Reserve Bank of NZ (http://www.rbnz.govt.nz/-/media/Reserve ... -daily.xls
and http://www.rbnz.govt.nz/-/media/Reserve ... 9-2013.xls). I want to download the 1999-2013 data and then append the second). I have no problem downloading either using an EViews programme but I want to get the data into a single workfile, including all the analyses I want to do. I want the combined ids to provide a single sequence of dates.
They're 2 files on the website of the Reserve Bank of NZ (http://www.rbnz.govt.nz/-/media/Reserve ... -daily.xls
and http://www.rbnz.govt.nz/-/media/Reserve ... 9-2013.xls). I want to download the 1999-2013 data and then append the second). I have no problem downloading either using an EViews programme but I want to get the data into a single workfile, including all the analyses I want to do. I want the combined ids to provide a single sequence of dates.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Appending date ids - possible?
Code: Select all
wfopen(type=excel) http://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-daily.xls
import(type=excel, resize, mode=u) http://www.rbnz.govt.nz/-/media/ReserveBank/Files/Statistics/tables/b1/hb1-daily-1999-2013.xls
Follow us on Twitter @IHSEViews
Re: Appending date ids - possible?
Thanks.
As you know, it works. Perhaps others with this dilemma will get this help.
As you know, it works. Perhaps others with this dilemma will get this help.
Re: Appending date ids - possible?
Hi
Since I posted this, the RBNZ has changed to xlsx files. I've tried to modify the procedure suggested above but can get only the data 1999-2013. Is there a way around this?
Since I posted this, the RBNZ has changed to xlsx files. I've tried to modify the procedure suggested above but can get only the data 1999-2013. Is there a way around this?
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Appending date ids - possible?
The xlsx file was not created by Excel and parts of it does not match the expected format.
If you resave the hb1-daily.xlsx file using Excel, EViews will read the file correctly.
If you resave the hb1-daily.xlsx file using Excel, EViews will read the file correctly.
Re: Appending date ids - possible?
Thanks that's precisely what I want to avoid. I used to do this.
Anyway, I can get the data via an R script. I want to get the data directly into an Eviews programme since for what I want to do is done far better in Eviews.
Also, I doubt that the files aren't Excel files.
There is a problem with https which I got around before by just dropping the s for the xls files.
Anyway, I can get the data via an R script. I want to get the data directly into an Eviews programme since for what I want to do is done far better in Eviews.
Also, I doubt that the files aren't Excel files.
There is a problem with https which I got around before by just dropping the s for the xls files.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Appending date ids - possible?
Your best bet is to contact the provider and ask them to fix their Excel making process - it has a bug.
Follow us on Twitter @IHSEViews
Re: Appending date ids - possible?
Thanks. I was intending to ring tomorrow (our time) to ask whether there's a problem with their files. However,as I indicated earlier, there appears to be no problem with reading the files into R. And your procedure with xls files worked really well.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Appending date ids - possible?
If you're going to speak to them, you can give them precise details.
If you download the two files and .xlsx and rename them to .zip you can then unzip them (.xlsx files are just zip files). Inside the zip folder there is an XL->Worksheets folder.
Download notepad++ (or any other good raw text editor) and open up the sheet1.xml file from both original files.
You'll notice the problem file (hb1-daily) has a single line - the xml data [the part following the <worksheets> tag] is on the same line as the xml specification line.
For the file that isn't a problem (hb1-daily-1999-2013), you'll notice that the <worksheets> tag is below the xml spec line.
If you download the two files and .xlsx and rename them to .zip you can then unzip them (.xlsx files are just zip files). Inside the zip folder there is an XL->Worksheets folder.
Download notepad++ (or any other good raw text editor) and open up the sheet1.xml file from both original files.
You'll notice the problem file (hb1-daily) has a single line - the xml data [the part following the <worksheets> tag] is on the same line as the xml specification line.
For the file that isn't a problem (hb1-daily-1999-2013), you'll notice that the <worksheets> tag is below the xml spec line.
Follow us on Twitter @IHSEViews
Re: Appending date ids - possible?
Thanks for this. It'll be very helpful as I really don't know anything about the inner workings of excel.
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Appending date ids - possible?
Actually the entire file being a single line is not the issue (I incorrectly told Gareth this). There are incorrect and missing tag in the worksheet.xml files. For example the data ranges for each sheet were incorrect and the column range for each row were also not to spec. If you like, you can have them contact me jason@eviews.com and I can tell them more specifically what is wrong and which tags we expect that are missing.
Who is online
Users browsing this forum: No registered users and 36 guests