Parse text with ( in it

General questions about using TextPad

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

Post Reply
steve1040
Posts: 39
Joined: Fri Oct 13, 2006 2:19 am

Parse text with ( in it

Post by steve1040 »

I have several lines of text that look like this:


ABS - Title1 (SYS-1121) (Fillable).pdf ( 200 KB )
ABS Something-High Here Orders and MAR (SYS-1122) (Fillable).pdf ( 247 KB )
ACT Low Something Orders and MAR (SYS-1342) (Fillable).pdf ( 254 KB )
MI ThisHere with Something (SYS-1560) (Fillable).pdf ( 120 KB )
Adult Attention Form (SYS-1782) (fillable) PSC.pdf ( 109 KB )

I need to get 2 fields from the lines into pipe delimited fields

So
Needed Result

ABS - Title1|SYS-1121
ABS Something-High Here Orders and MAR|SYS-1122
ACT Low Something Orders and MAR|SYS-1342
MI ThisHere with Something|SYS-1560
Adult Attention Form|SYS-1782
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ([^(]*) \(([^)]+)\).*
Replace with: \1|\2

[X] Regular expression

Replace All
Post Reply