Page 1 of 1

Error while importing an Excel file

Posted: Thu Jan 05, 2017 12:06 pm
by BigD
Hi,
I'm pretty new to EViews and I was trying to import an excel file using this code:

Code: Select all

import "a.xlsx" byrow colhead=2 namepos=first @freq a 1971
It throws this error when I run it:
File'C:\Users\b\AppData\ev_temp\evxlsx\[content_types].xml' does not match expected format in "IMPORT "A.XLSX" BYROW COLHEAD=2 NAMEPOS=FIRST @FREQ A 1971".
I'm not too sure what it means.

Here's some additional information:
That a.xlsx is created by converting a .csv file to a.xlsx using a Python script (because EViews couldn't read the entire time series due to formatting issues in the .csv file).
I tested the same code with a different Excel file (that I manually renamed from .csv to .xlsx) and it worked.
Using EViews 9.5

Any help is appreciated.
Thanks!

Re: Error while importing an Excel file

Posted: Thu Jan 05, 2017 2:39 pm
by BigD
Nevermind the error above. I did some changes to the program and suddenly got this error:
Unable to match source and destination in "IMPORT "P:\~\A.XLSX" BYROW COLHEAD=2 NAMEPOS=FIRST @FREQ A @SMPL @ALL".
What does this mean?
Also, I used the same code for another independent program and it worked fine.

Re: Error while importing an Excel file

Posted: Thu Jan 05, 2017 2:42 pm
by EViews Gareth
That error indicates that EViews isn't able to match the structure of the incoming file with that of the destination workfile you're importing it into. Without seeing both files it is hard to be more specific.

Re: Error while importing an Excel file

Posted: Thu Jan 05, 2017 3:01 pm
by BigD
The destination workfile is a temporary one. But, it should have similar structure as the .csv file (which works while importing but doesn't read full time series sometimes). But by importing newdata.xlsx, that error comes up.

Re: Error while importing an Excel file

Posted: Thu Jan 05, 2017 3:13 pm
by startz
If you drop-and-drag the Excel file onto EViews, clicking transpose, it appears to load in fine. Perhaps you should load as a new workfile and then do whatever merging you need?

Re: Error while importing an Excel file

Posted: Fri Jan 06, 2017 10:26 am
by BigD
Right, I'll try that. Thanks.

As for the previous error message, I realized that the package I used in Python probably didn't convert .csv to .xslx properly hence the format was probably off. Which was why Eviews couldn't recognize it. I used a different package and solved that error.