Mark All

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
gcotterl
Posts: 248
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Mark All

Post by gcotterl »

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).
ACRobin
Posts: 134
Joined: Fri Nov 04, 2005 9:51 pm
Location: Northumberland,UK
Contact:

Post by ACRobin »

Any way I could see is to split the file in two (or more) and open/search that portion.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

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.
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

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.
(2[Bb]|[^2].|.[^Bb])

That is the question.
Post Reply