Page 1 of 1
Exporting multitables from EViews to Spreadsheet
Posted: Fri Mar 01, 2013 9:21 am
by jdollery
Hello,
My workfile contains 12 pages, each page has a result table (called table1). As each workfile contains 12 pages, so it has 12 tables(results). Now I need to export these 12 tables(results) from each page into a speadsheet, I would be very grateful if you could help me with some codes, so I can run it in order to export 12 tables(results) from different pages to an excel sheet in one go.
Thank you very much for your reply.
Jian
Re: Exporting multitables from EViews to Spreadsheet
Posted: Fri Mar 01, 2013 9:42 am
by EViews Gareth
Use the copy command to copy the tables into the same page, then create a spool (using the spool command), add the tables to the spool (spool.append), then finally save the spool to disk as a csv file (spool.save).
Re: Exporting multitables from EViews to Spreadsheet
Posted: Fri Mar 01, 2013 10:19 am
by jdollery
Many thanks Gareth. I will try it.
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 4:00 pm
by jdollery
Dear Gareth
According to your advice, I've tried to copy all the tables from different pages into sheet2. I use copy command, but it doesn't work, error message shows - "bad object specification". I' m not sure where I've got wrong, my code is below:
wfopen C:\Users\HUBS\Desktop\cocoa_nd.wf1
'I need to copy all the tables from different pages into sheet2. I use the copy command, but it doesn't work, error message shows - bad object specification
copy src_sheet3\src_table2 dest_sheet2\
copy src_sheet4\src_table3 dest_sheet2\
....
copy src_sheet12\src_table12 dest_sheet2\
Many thanks for your help in advance.
Kind regards,
Jian
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 4:06 pm
by EViews Gareth
You need to give it a name on the destination sheet.
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 4:15 pm
by jdollery
I'm really sorry as a beginner in programming, I'm not sure what you meant. Could you give a specific example or change my code below to show me. Many thanks.
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 4:41 pm
by EViews Gareth
Code: Select all
copy src_sheet3\src_table2 dest_sheet2\src_table2
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 4:56 pm
by jdollery
After I run your code (copy src_sheet3\src_table2 dest_sheet2\src_table2), I still got the error message, ie, " Bad object specification src_sheet3\src_table2 in "COPY src_sheet3\src_table2 dest_sheet2\src_table2". I don't know why, would appreciate your advice.
Re: Exporting multitables from EViews to Spreadsheet
Posted: Sat Mar 02, 2013 6:12 pm
by EViews Gareth
Hard to say, it looks ok.
Re: Exporting multitables from EViews to Spreadsheet
Posted: Thu Mar 07, 2013 1:28 pm
by jdollery
Hello
I want to collect all the tables from different pages to one page, but the code (copy src_sheet3\src_table2 dest_sheet2\src_table2) couldn't work. To find the reason, I now try copying a table within the same page using the following code:
Copy src_table1 dest_table2 But again an error message appears - "src_table1 is not defined". My question: How to define src_table1 (table1 is already in the page)?
Many thanks for your help.
Jian
Re: Exporting multitables from EViews to Spreadsheet
Posted: Thu Mar 07, 2013 2:07 pm
by EViews Gareth
Code: Select all
wfcreate(page=page_a) u 10
table taba
pagecreate(page=page_b) u 10
table tabb
pagecreate(page=page_c) u 10
table tabc
pagecreate(page=page_d) u 10
copy page_a\taba page_d\taba
copy page_b\tabb page_d\tabb
copy page_c\tabc page_d\tabc
Re: Exporting multitables from EViews to Spreadsheet
Posted: Thu Mar 07, 2013 3:45 pm
by jdollery
Many thanks Gareth.