Extract & Save

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Guest

Extract & Save

Post by Guest » Thu Nov 10, 2005 3:30 pm

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
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Thu Nov 10, 2005 4:06 pm

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

Post by Guest » Thu Nov 10, 2005 4:08 pm

Thanks, this works great!
Post Reply