Page 1 of 1

Search by column

Posted: Sun Oct 23, 2016 7:04 pm
by gcotterl
Textpad appears to search by row (i.e., horizontally).
Is there any way to search by column (i.e., vertically)?

Posted: Mon Oct 24, 2016 7:55 am
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.

Posted: Tue Oct 25, 2016 6:16 pm
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)

Posted: Tue Oct 25, 2016 8:31 pm
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.

Posted: Sat Oct 29, 2016 7:04 pm
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)

Posted: Sat Oct 29, 2016 7:19 pm
by ben_josephs
Is that not what I described in my first comment above?

Posted: Sun Oct 30, 2016 4:18 pm
by gcotterl
So TEXTPAD can't do what I want?

Posted: Mon Oct 31, 2016 3:09 pm
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.

Posted: Mon Oct 31, 2016 7:57 pm
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.

Posted: Mon Oct 31, 2016 8:17 pm
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.

Posted: Mon Oct 31, 2016 10:29 pm
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.