Modify

Opened 10 years ago

Closed 10 years ago

#1263 closed Feature Request (Rejected)

Request: Delete a Line from a File (FileDeleteLine)

Reported by: eru Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Delete Line, FileDeleteLine, FileReadLine Cc:

Description

At the moment, there is no way to delete a specific line from a file, short of writing all the lines you don't want to delete to a new file.

I have a script that parses my a log file to remove unnecessary items, and it can be quite large at times - over 200,000 lines.

FileReadLine gets to get slower as the line number gets higher, so as I'm getting close to the end of the log file, it gets to be extremely sluggish.

If I could use FileDeleteLine after the FileReadLine, it would speed things up a lot since I could have it read the first line, evaluate it, then after it either writes or discards it, delete that line.

That way, FileReadLine would always be reading the first line and would function much faster for larger files.

Of course, there are more uses for such a command, but this is the one that affects me currently.

Thanks!

Attachments (0)

Change History (2)

comment:1 Changed 10 years ago by TicketCleanup

  • Version 3.3.0.0 deleted

Automatic ticket cleanup.

comment:2 Changed 10 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

You're using FileReadLine() wrong. Otherwise, there's no point in this feature because it will be implemented exactly how you describe.

To use FileReadLine() correctly do not pass a line number. This reads the "next" line instead of calculating the correct line to read.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.