Extract & Save

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Extract & Save

by Guest on Thu Nov 10, 2005 8:30 am

I am using the EXTRACT command to extract data, and I am running it in loops. The problem is that when it loops, it saves over the previous loop. I need each loop saved as a seperate file, how do I do that?

Here is the macro I am using. How do I get it save the extracted data under a unique file name each time it loops?

Code: Select all
VERSION BUILD=4310722     
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://www4.pinnaclesports.com/vwGuestLines.asp?redirected=yes&sportType=Football&sportSubType=NFL&descr=NFL     
SIZE X=1132 Y=849
SET !EXTRACT_TEST_POPUP NO   
EXTRACT POS=1 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=3 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=4 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=6 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=9 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=10 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=12 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=1 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=15 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=16 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=18 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=21 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=22 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=24 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=27 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=28 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=30 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=33 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=34 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=36 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=39 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=40 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=42 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=45 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=46 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
EXTRACT POS=48 TYPE=TXT ATTR=<TD<SP>class=main_body_blk<SP>noWrap>*   
SAVEAS TYPE=EXTRACT
Guest
 

by Tech Support on Thu Nov 10, 2005 9:06 am

You can use
Code: Select all
SAVEAS TYPE=EXTRACT FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhmmss}}.csv

or
Code: Select all
SAVEAS TYPE=EXTRACT FOLDER=* FILE=mytable_{{!LOOP}}.csv

Now it creates a new file with each loop.
User avatar
Tech Support
 
Posts: 5003
Joined: Tue Sep 20, 2005 12:25 pm

by Guest on Thu Nov 10, 2005 9:08 am

Thanks, this works great!
Guest
 


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: Google [Bot] and 1 guest

-->