delete entry in csv after used it once

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
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
XpressMe
Posts: 1
Joined: Fri Jul 05, 2013 9:15 am

delete entry in csv after used it once

Post by XpressMe » Fri Jul 05, 2013 9:23 am

hi

want to ask how to delete a entry in the csv file after used it

here is my code

Code: Select all

TAB T=1
TAB CLOSEALLOTHERS

CLEAR

SET !DATASOURCE Usernames.csv
SET !DATASOURCE_LINE {{!LOOP}}

PROXY ADDRESS={{!COL3}}

SET !EXTRACT NULL
SET !VAR8 NULL
URL GOTO=http://10minutemail.net/de/
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:fe_text EXTRACT=TXT
SET !VAR8 {{!EXTRACT}}
....
....
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form_signup ATTR=NAME:login CONTENT={{!COL1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form_signup ATTR=NAME:pwd1 CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form_signup ATTR=NAME:pwd2 CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form_signup ATTR=NAME:email CONTENT={{!VAR8}}
....
....
after i used once a line {{!COL1}}+{{!COL2}}+{{!COL3}}
i want to delete the entry in the csv file that NEVER the same col1+2 are used again

the csv file has 30.000 entrys and i only use 3-5 a day.
and i dont want to register with same name and password again each new day

can someone help me ??

thanks
User avatar
garyst1981
Posts: 125
Joined: Tue Jan 15, 2013 1:01 am
Location: Philadelphia, PA
Contact:

Re: delete entry in csv after used it once

Post by garyst1981 » Tue Aug 06, 2013 12:22 pm

can't do with iMacros.

iMacros can just read from a CSV file. Or create and entry data in a CSV.

You will need something else to do it.

You could create a CSV file with the data already use it, with iMacros, I don't know if that could help you
www.gustavorivera.com.mx
User avatar
FoxDot
Posts: 20
Joined: Thu Jun 13, 2013 2:31 pm
Location: Chisinau
Contact:

Re: delete entry in csv after used it once

Post by FoxDot » Wed Aug 14, 2013 10:12 am

An alternative, as a solution, I would use a temporary CSV file (temp_loop.csv), where I would save the last loop value - which will be the last line of proxy used, and no need do delete any line from proxies csv.

You need to code in a js file, something like:

Load the temp_loop.csv file (where for the first time default value is 1)
Save the value from temp_loop.csv to a new variable (new_var), which will be your new loop value
Delete the temp_loop.csv
Using this value: SET !DATASOURCE_LINE {{new_var}} and loop through your proxies csv
At the end of the program save the last value of new_var in temp_loop.csv

As an example:

Code: Select all

var new_var = 1, n;
n = parseInt(prompt("How Many Proxies Do You Want To Load?","3"));
iimPlay("CODE:SET !DATASOURCE D:\\temp_loop.csv");
 if(iimGetLastError()=='OK')
    {
     iimPlay("CODE:SET !DATASOURCE D:\\temp_loop.csv\nSET !DATASOURCE_LINE 1\nSET !EXTRACT {{!COL1}}");
     new_var = iimGetLastExtract();
     iimPlay("CODE:FILEDELETE NAME=D:\\temp_loop.csv");
     }

var proxy = "CODE:TAB T=1\nTAB CLOSEALLOTHERS\nCLEAR\n";
      proxy += "SET !DATASOURCE Usernames.csv\nSET !DATASOURCE_LINE {{loop}}\n"; 
      proxy += "PROXY ADDRESS={{!COL3}}\nSET !EXTRACT NULL\nSET !VAR8 NULL\n";
      proxy += "URL GOTO=http://10minutemail.net/de/\nTAG POS=1 TYPE=INPUT:TEXT ATTR=ID:fe_text EXTRACT=TXT\n";
      proxy += "SET !VAR8 {{!EXTRACT}}\n....\n....\n";
      proxy += "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form_signup ATTR=NAME:login CONTENT={{!COL1}}\nSET !ENCRYPTION NO\n";
      proxy += "TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form_signup ATTR=NAME:pwd1 CONTENT={{!COL2}}\n";
      proxy += "TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:form_signup ATTR=NAME:pwd2 CONTENT={{!COL2}}\n";
      proxy += "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form_signup ATTR=NAME:email CONTENT={{!VAR8}}\n";
      proxy += "....\n....\n";

do
 {
  iimSet("loop", new_var);
  iimPlay(proxy);
  new_var++;
  n--;
}
while(n!=0);

iimSet("loop", new_var);
iimPlay("CODE:SET !EXTRACT {{loop}}\nSAVEAS TYPE=EXTRACT FOLDER=D:\\ FILE=temp_loop.csv");

I'm storing the temp_loop file in D drive, you can indicate other desired location.

Note: Save this code in a *js file (NOT *iim) and hit the Play button and don't forget to adjust the proxy macro (the dots - ....), otherwise it will not work.
The Fox Will Find You!
Post Reply