data read in (easy question!)

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

seahorse
Posts: 13
Joined: Tue Mar 26, 2013 10:24 am

data read in (easy question!)

Postby seahorse » Wed Aug 06, 2014 12:20 pm

I am sorry this is such a basic question I am fairly new to Eviews (version 8). I am trying to read in many Excel worksheets and the number of columns with data will vary from month to month. For some sheets I can specify no range but others I have to specify the range. Can someone explain why in the attached example the sheet HI can read in without any range defined but the sheet dummies cannot (gives the error no valid series)? It seems random to me which ones need a range and which do not and it is driving me nuts (for example the OTH sheet also needs the range)! In the attached code the commented out line reads the data in fine, but the code in the loop does not - yet it is fine for the HI sheet.

Thanks in advance!

CODE:

' read in the data test

wfopen(page=OTH) "BBREADIN.xlsm" range= "OTH!a1:ce87" colhead = 11 namepos = first

'pageload(page=dummies) "BBREADIN.xlsm" range="dummies!a1:ca87" colhead=11 namepos = first

for %i HI DUMMIES
pageload(page={%i}) "BBREADIN.xlsm" range={%i} colhead=11 namepos=first
next
Attachments
bbreadin.xlsm
(92.96 KiB) Downloaded 362 times

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: data read in (easy question!)

Postby EViews Chris » Wed Aug 06, 2014 2:53 pm

The differences you are seeing are due to the contents of row 11 in the sheets.

In the pages DUMMIES and OTH this row is completely blank. In the sheet HI this row contains a value.

It matters because EViews considers blank lines as separators between different sections of the sheet (tables, headings, footnotes, etc.).

So in HI EViews thinks the sheet contains a single large table. In DUMMIES and OTH, EViews sees the column header as a separate table from the data below (because of the blank line between the two).

If you remove row 11 from the problem sheets or make sure that row 11 contains at least one value (eg. by putting a string of spaces into cell A11) then EViews will read the data as expected.

I'm afraid we don't currently have an option to tell EViews to ignore the blank line. It's not a bad idea, but the automatic file reading is pretty complicated so it's not a simple change.

seahorse
Posts: 13
Joined: Tue Mar 26, 2013 10:24 am

Re: data read in (easy question!)

Postby seahorse » Thu Aug 07, 2014 1:36 am

Brilliant Chris, cant tell you how much time this will save, quick change in Ssheet this morning and my code is cut down by 90%. Excellent stuff, thank-you. this forum is so helpful.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 27 guests