How to find lines with caracter not in selected column

General questions about using TextPad

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

Post Reply
Ghorin
Posts: 1
Joined: Thu Sep 15, 2011 4:32 pm

How to find lines with caracter not in selected column

Post by Ghorin »

Hi,

I have files with lines like

Code: Select all

AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAA@AAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAA$AAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
AAAAAAAAAAAAAAAAAA13AAAAAAA
- AAAA may be anything (numeric, ajpha).
- All lines should have nomber 13 at same position but due to a wrong caracter before the number 13 column, some lines have the 13 one character drift on the right (as in lines 5 and 7 of my example)

My need is the regexp to find all lines where 13 is not at right position. I though about looking all lines where 13 is not at position (in that example : 19 = right, 20 = wrong)

Does anybody knows what regexp to use for that (or other idea). Thanks[/code]
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Code: Select all

^.{19}13
^ start at beginning of line
.{19} 19 characters (whatever they are)
13 the 13

If the 13 could be more than 1 character off its rightful position, use

Code: Select all

^.{19,}13
(which searches for 19 or more characters)

But beware, this fails if there are lines with more than one 13 in it ...[/code]
User avatar
woho
Posts: 100
Joined: Tue Sep 02, 2003 9:12 am
Location: Steyr/Austria
Contact:

Post by woho »

to beware of Mudguard's 2nd case you could also try it vice versa:
1) find correct lines with
^.{18}13
2) 'Mark all' button in search dialog
=>Boomarks in all correct lines
3) Select all (Ctrl + A)
4) menu Search/Toggle Bookmarks (Ctrl+F2)
=> Bookmarks in wrong lines

WoHo
Post Reply