Find + Replace regex question :(

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
crazzeto
Posts: 2
Joined: Thu Sep 24, 2009 2:17 pm

Find + Replace regex question :(

Post by crazzeto »

I have a question about whether something is possible. I was given a flat file to be imported into our companies database. The flat file is in some bizzaro format which was invented by the person that exported it. There is a pattern I can use to get it into CSV format though :

I need to change the regex patter [0-9]\n to [0-9],

So basically I need to look for a number followed by new line and replace that with the SAME NUMBER that was there before and just change the new line to a comma. Is that even possible?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ([0-9])\n
Replace with: \1,

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
crazzeto
Posts: 2
Joined: Thu Sep 24, 2009 2:17 pm

Post by crazzeto »

Thanks so much, that helped
Post Reply