Is there a way to do MARK ALL on the rows in a part of a text file?
For example:
My file has 1 million rows
MARK ALL finds the "FIND WHAT" string in 800,000 rows.
When I click CUT OTHER (or COPY OTHER) then click BOOKMARKED LINES, Textpad won't cut or copy all 800,000 lines.
Is there any way to select a portion of the file (say lines 1 thru 60000) then do the SEARCH and MARK ALL only within the selected range?
(I'm using TP 7.2.0 (32-bit).
Mark All
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
You want to mark the lines that are both in the selection and contain some string.
You can't do this directly. If you mark the lines satisfying condition A and then mark the lines satisfying condition B, you have marked the lines satisfying either condition A or condition B. There is no direct way to mark the lines satisfying both condition A and condition B.
However, logic (specifically, De Morgan's laws) tells us that
A and B = not ( not A or not B )
You can achieve not by inverting bookmarks (Search | Invert All Bookmarks).
You can mark lines not containing string S by marking lines matched by the regex
^(?!.*S)
If S contains special regex characters, use
^(?!.*\QS\E)
So you can mark all the lines in some range that contain some string like this:
1. Mark the range.
2. Invert all bookmarks (Search | Invert All Bookmarks).
3. Mark the lines not containing the string.
4. Invert all bookmarks.
This will be slow on large files.
You can't do this directly. If you mark the lines satisfying condition A and then mark the lines satisfying condition B, you have marked the lines satisfying either condition A or condition B. There is no direct way to mark the lines satisfying both condition A and condition B.
However, logic (specifically, De Morgan's laws) tells us that
A and B = not ( not A or not B )
You can achieve not by inverting bookmarks (Search | Invert All Bookmarks).
You can mark lines not containing string S by marking lines matched by the regex
^(?!.*S)
If S contains special regex characters, use
^(?!.*\QS\E)
So you can mark all the lines in some range that contain some string like this:
1. Mark the range.
2. Invert all bookmarks (Search | Invert All Bookmarks).
3. Mark the lines not containing the string.
4. Invert all bookmarks.
This will be slow on large files.
In a file of about a million records, instead of cutting 800K selected records, try:
Search, Invert All Bookmarks
Edit, Cut Other, Bookmarked Lines
That would remove the 200K records that were NOT selected and leave you with just the 800K records that were selected.
Search, Invert All Bookmarks
Edit, Cut Other, Bookmarked Lines
That would remove the 200K records that were NOT selected and leave you with just the 800K records that were selected.
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.