How can i remove one line data after imacros has loop?

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
fdoudou
Posts: 4
Joined: Mon Sep 19, 2011 8:29 am

How can i remove one line data after imacros has loop?

Post by fdoudou » Wed Sep 21, 2011 9:34 am

Hey,everyone.
Is there any method that imacros can remove the data that has loop?
Here is the code

Code: Select all

VERSION BUILD=7300701 RECORDER=FX
CMDLINE !DATASOURCE amazon.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
URL GOTO=http://www.amazon.com/
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:site-search ATTR=ID:twotabsearchtextbox CONTENT={{!COL1}}
I want to remove one line data in amazon.txt after imacros every time loop.
Can everyone have a good idea? :lol:
Hannes, Tech Support

Re: How can i remove one line data after imacros has loop?

Post by Hannes, Tech Support » Wed Sep 21, 2011 12:22 pm

You extract some text, but then want to manipulate it before saving?
The beta feature "EVAL" should do the trick.
Cf. http://wiki.imacros.net/iMacros_for_Fir ... on_History
iLoad
Posts: 3
Joined: Tue Nov 29, 2011 9:31 am

Re: How can i remove one line data after imacros has loop?

Post by iLoad » Wed Feb 08, 2012 1:14 pm

I have the same issue!

I want to edit a text file by removing the 1st line when the imacros has finished playing (I couldn't find out how the EVAL would work on datasource files)

Any other ways to have it done? I'd be glad to have a short javascript for that?
Tom, Tech Support
Posts: 3461
Joined: Mon May 31, 2010 4:59 pm

Re: How can i remove one line data after imacros has loop?

Post by Tom, Tech Support » Tue Feb 21, 2012 12:58 am

iMacros itself does not have the ability to update or delete lines within a file. It can only append lines to the file, or delete the whole file (using the FILEDELETE command).
Regards,

Tom, iMacros Support
User avatar
Edoctoor
Posts: 34
Joined: Sun Nov 29, 2015 7:53 pm

Re: How can i remove one line data after imacros has loop?

Post by Edoctoor » Wed Dec 16, 2015 11:28 pm

Workaround

If your file is very very small; you might try reading the SECOND RECORD and saving the SECOND RECORD into another file name as the first RECORD... and then looping throught the rest of the file until the end.. then deleting the orginal file... of course you will have to redo the process if you want re-read/re-write the file as the orginal file name.. but it might be easier to just adjust your macro to use the new filename.

Best regards
iMacros Version 11.0.246.4051
Browser FireFox 42.0
OS Windows 7 Home Premium - Service Pack 1

Before starting a topic please read the following; thank you!
http://forum.imacros.net/viewtopic.php?f=20&t=3331#p8799
Post Reply