Search by column

General questions about using TextPad

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

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

Search by column

Post by gcotterl »

Textpad appears to search by row (i.e., horizontally).
Is there any way to search by column (i.e., vertically)?
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Do you mean you want it to find the matches of your search expression in a different order, so that, for example, it finds matches for the regex \d in numerical order in the text

Code: Select all

xxx 1 xxx 5 xxx
xxx 2 xxx 6 xxx
xxx 3 xxx 7 xxx
xxx 4 xxx 8 xxx
?

No, it can't do that.
gcotterl
Posts: 238
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Post by gcotterl »

No.

I want Search to look for the expression from left-to-right (i.e., in position 1, 2, 3, etc.) not row-by-row)
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

I don't know what you mean.

Please give an example and describe how what you want TextPad to do differs from what it does do.
gcotterl
Posts: 238
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Post by gcotterl »

Here's the data:

2009:09:30 19:44:44 2016:04:23 06:49:53
2016:04:23 06:49:53 2016:04:23 06:49:53

I want Search to find '2016:04:23 06:49:53' starting in position 1 (in row 2) before it finds that expression starting in position 21 (in row 1)
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Is that not what I described in my first comment above?
gcotterl
Posts: 238
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Post by gcotterl »

So TEXTPAD can't do what I want?
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

If that's what you meant then no, it can't.

You can, of course, use regular expressions to search for text only within some number of characters from the beginning of a line, but that's not what you asked for.
User avatar
AmigoJack
Posts: 490
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

You could use block mode (Configure > Block Select Mode), then select your "column" and search on selection only. (Edit: no, you can't)

After all, text files never have columns - thus don't expect a text editor to know your definition of where a column ends and the next begins.
Last edited by AmigoJack on Mon Oct 31, 2016 10:23 pm, edited 1 time in total.
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You can't restrict a search to a selection. You can only restrict a replacement to a selection.

Besides, gcotterl didn't ask to restrict a search. He asked to change the order in which matches are found.
User avatar
AmigoJack
Posts: 490
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

My bad: you really can't search on selection. After all those years I always thought it was there as option, yet I never needed it. (But it wouldn't be senseless either.)

I can't even start to think about treating text as columns: the search goes thru text in a stream. Seeking column-wise (we still don't know by what columns are separated... tabs? spaces?) would mean to let the search make multiple jumps in the text stream. Which is technically possible, but questionably worth the cost of work it needs.
Post Reply