Extract every other position?

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
erikcw
Posts: 34
Joined: Sun Nov 13, 2005 5:08 pm

Extract every other position?

Post by erikcw » Mon Nov 14, 2005 2:38 pm

Hi,

Is it possible to create a macro that will loop through a table extracting every other postion? (ie just extract the even postion numbers)
1. itema
2. itemb
3. itemc
4. itemd
5. iteme
6. itemf
This data is in a table, so "1." is POS 1 and itema is in POS 2. Basically all the item numbers are in odd POS and the data is in even POS.

Can I make the loop extract every other value? The programing equivalent of {{!LOOP}}++?

I tried extracting the whole table, but instead of putting it in a cvs file it lumps all the data togeather...

Thanks for your help!
Guest

Post by Guest » Tue Nov 15, 2005 4:15 am

in order to do so, i believe u hv to intergrate it with some other program languages, and then pass in the position as a variable

at least... that's how i did it... any other better suggestions?
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Wed Nov 16, 2005 12:56 am

"Guest" is right: This can be done using the Scripting Interface:

For m=1 to 100 step 2
i = iim1.iimSet ("-var_mypos", cstr(m))
i = iim1.iimPlay ("your_macro")
Next

=> replace POS={{!LOOP}} with POS={{mypos}} in the macro.
Post Reply