Ben Jost
Ben Jost

Reputation: 329

Use mutliple datasource in one iMacros

Is there a way to use multiple !DATASOURCES in one script?

F.ex.

SET !DATASOURCE test1.csv
PROMPT {{!COL1}}
SET !DATASOURCE test2.csv
PROMPT {{!COL1}}

Upvotes: 0

Views: 896

Answers (1)

Poyke
Poyke

Reputation: 655

You can use them both if you override them one after the other with each run. If lines sync up you can use it just like you wrote, if they don't match up you can create an algorithm that changes lines to be !VAR1 and !VAR2 according to !LOOP in any way you like.

Example from a working Macro of mine:

SET !LOOP 2
SET !DATASOURCE C:\Temp\ips.csv 
SET !DATASOURCE_LINE {{!LOOP}} 
PROXY ADDRESS={{!COL1}} BYPASS=*deathbycaptcha.com*
SET !VAR1 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 6; i++){string += letters[parseInt(Math.random() * 25)]}; string")
SET !VAR2 EVAL("var letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']; var string = ''; for(var i = 0; i < 10; i++){string += letters[parseInt(Math.random() * 25)]}; string")
SET !DATASOURCE C:\Temp\Gmail.csv 
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=https://accounts.google.com/SignUp?service=mail&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&hl=en

Instead of setting DATASOURCE_LINE to be !LOOP it can be a another custom !VAR

Upvotes: 1

Related Questions