Find and replace question

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
MT
Posts: 5
Joined: Tue Nov 06, 2007 4:27 pm

Find and replace question

Post by MT »

Hi,
I have a csv file that contains a number that begins with 3 and is 7 digits long
Could someone give me some info on how I would go about selecting only the number and placing " at the beginning and end of the number between the comma s . i.e ,3000577, with ,"3000577", . I've tried a few expressions but am struggling as it seems to pick up strings elsewhere in the file i.e ,30.8,"", .

Thanks
Last edited by MT on Tue Nov 06, 2007 4:52 pm, edited 1 time in total.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ,(3[0-9]{6}),
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
MT
Posts: 5
Joined: Tue Nov 06, 2007 4:27 pm

Post by MT »

Thanks for that works a treat . the placing of the brackets got me on that expression .
Post Reply