Using \t, cant replace a character with a tab

General questions about using TextPad

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

Post Reply
cglenn
Posts: 7
Joined: Mon May 05, 2003 5:15 pm

Using \t, cant replace a character with a tab

Post by cglenn »

Using V4.7.0. I have a tab delineated text file. The programmer messed up a little, and some fields are separated by a fence (|) instead of a tab.

Under the replace context help, note #3, says to use \t . This does not work. All it did was replace fences with \t's.

Known problems did not have a topic on this. Forum search for replace tab \t had 550 hits, none relevant in the first many. Tried replace and tab and \t and got two hits, neither with my problem.
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

On the serach&replace dialog window you need to click the checkbox for "use regular expressions"

Otherwise, you could copy a tab character to the clipboard and paste it to the replace field.

Hope that helps
cglenn
Posts: 7
Joined: Mon May 05, 2003 5:15 pm

Post by cglenn »

Bingo. That little regular expressions detail wasn't in the help notes. Thank-you.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

On that page, it says at the top:

Replacement expressions are used to substitute text in conjunction with Tagged Regular Expressions, when using the Replace command.

And it says at the bottom:

Beware of replacing a pattern that is matched with a regular expression that can optionally match nothing, such as ".?" or "a*". In these degenerate cases, TextPad can go into a loop, until the line becomes too long.


Two hints that the stuff is for Regular expression replacement...
Post Reply