I have a text log with 583,000 lines in it. I want to delete the text after a certain line number. Can I do this in an easy way in Textpad without manually selecting it?
Thanks in advance
Deleting text after a certain line number
Moderators: AmigoJack, bbadmin, helios, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
The suggestion for easy manual delete is good, but I think he wants to avoid going to the line to select it for deletion.
It could be done with RegEx but would require putting the exact number of \n chars from the cursor position since TextPad RegEx is line based. Maybe WildEdit would do a better job because it can handle multiple lines?
It could be done with RegEx but would require putting the exact number of \n chars from the cursor position since TextPad RegEx is line based. Maybe WildEdit would do a better job because it can handle multiple lines?
Hope this was helpful.............good luck,
Bob
Bob
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
If the line has a keyword at the end, then you can use RegEX to delete that line. Not sure if you wanted to delete the next line, or all of the following lines. This will not work for multiple lines unless they all have the same keyword.
Search for: ^.*keyword\n
Replace with: nothing
====================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Search for: ^.*keyword\n
Replace with: nothing
====================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Last edited by Bob Hansen on Fri Sep 04, 2009 2:07 pm, edited 1 time in total.
Hope this was helpful.............good luck,
Bob
Bob
In your first posting, you mentioned a line number.Sitethief wrote: I have a text log with 583,000 lines in it. I want to delete the text after a certain line number.
[...]
I wanted to avoid scrolling down the entire section. Takes me roughly 20 minutes of pushing one mouse button
Ctrl-G (Or Search - Go To), then select "Line", then enter the number, then click Go To.