find tabs or lack there of

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
jazzastronomer
Posts: 36
Joined: Sat Nov 03, 2007 3:04 am

find tabs or lack there of

Post by jazzastronomer »

Hi
Sorry for the newbie question, I'm not a programmer.

I'm looking at a flashcard file. It is a tab delimited file, with tabs separating the fields on each line.

I'd like a couple of regex please.

1) bookmark every line where number of tabs is 0. There is no tabs on a line

2) bookmark every line where number of tabs is 1. There is exactly one tab on a line.

3) bookmark every line where number of tabs is greater then one. That is 2 or more tabs on a line.

thanks
jazzastronomer
Posts: 36
Joined: Sat Nov 03, 2007 3:04 am

Post by jazzastronomer »

this

search for [^\t+]
replace with nothing

Is what I'm using now but it just shows a list of all of the tabs. I'm working with a big file and would like to bookmark lines instead.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Click Search > Find.

1) To bookmark every line where the number of tabs is 0:

Find what: ^[^\t]*$

2) To bookmark every line where the number of tabs is 1:

Find what: ^[^\t]*\t[^\t]*$

3) To bookmark every line where the number of tabs is greater than 1:

Find what: [^\t]*\t[^\t]*\t[^\t]*

Click Mark All.
jazzastronomer
Posts: 36
Joined: Sat Nov 03, 2007 3:04 am

Post by jazzastronomer »

thanks AK47WONG

works fine. Thanks very much!

I'm guessing there is no option to visualize spaces in the Find what: search input box? Those invisible, but match changing spaces are really annoying.

thanks again
coho
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Unfortunately not. I sometimes find it useful to compose the search expression in TextPad itself (or even Notepad) and then copy and paste it to the Find dialog.
Post Reply