Exporting multitables from EViews to Spreadsheet

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Exporting multitables from EViews to Spreadsheet

Postby jdollery » Fri Mar 01, 2013 9:21 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting multitables from EViews to Spreadsheet

Postby EViews Gareth » Fri Mar 01, 2013 9:42 am

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).

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Fri Mar 01, 2013 10:19 am

Many thanks Gareth. I will try it.

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Sat Mar 02, 2013 4:00 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting multitables from EViews to Spreadsheet

Postby EViews Gareth » Sat Mar 02, 2013 4:06 pm

You need to give it a name on the destination sheet.

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Sat Mar 02, 2013 4:15 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting multitables from EViews to Spreadsheet

Postby EViews Gareth » Sat Mar 02, 2013 4:41 pm

Code: Select all

copy src_sheet3\src_table2 dest_sheet2\src_table2

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Sat Mar 02, 2013 4:56 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting multitables from EViews to Spreadsheet

Postby EViews Gareth » Sat Mar 02, 2013 6:12 pm

Hard to say, it looks ok.

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Thu Mar 07, 2013 1:28 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exporting multitables from EViews to Spreadsheet

Postby EViews Gareth » Thu Mar 07, 2013 2:07 pm

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

jdollery
Posts: 13
Joined: Thu Feb 28, 2013 9:16 am

Re: Exporting multitables from EViews to Spreadsheet

Postby jdollery » Thu Mar 07, 2013 3:45 pm

Many thanks Gareth.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest