remove info in lines beginning with 65

General questions about using TextPad

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

Post Reply
jan-01
Posts: 19
Joined: Fri Apr 27, 2007 9:40 am

remove info in lines beginning with 65

Post by jan-01 »

Hello

I must remove numbers and the notes of exclamation, in lines beginning with '65' in lots of records...
Is it possible to make an regular expression to do this ?

old record...

4701 mc
4900 01-06-11 18:57:48.000
6501 !333331370!Jamaica
6502 !33334166X!Russia
6503 !333372891!Dutch
7001 31-05-11 : zmcapxl
7100 M 2011 A 1616 \ c

new record...

4701 mc
4900 01-06-11 18:57:48.000
6501 Jamaica
6502 Russia
6503 Dutch
7001 31-05-11 : zmcapxl
7100 M 2011 A 1616 \ c

Thanks for helping,
Jan
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Enable POSIX regular expression syntax in Configure > Preferences > Editor.

Then perform this Replace operation:

Find what: ^(65.*_)!.*!(.*) [replace the underscore with a space]
Replace with: \1\2
[X] Regular expression
Click Replace All
jan-01
Posts: 19
Joined: Fri Apr 27, 2007 9:40 am

Post by jan-01 »

thanks!!
Nico
Posts: 6
Joined: Thu Oct 02, 2003 2:49 pm

remove text after the last note of exclamation

Post by Nico »

Hello ak47/wong,

No I must remove all text after the last note of exclamation, in all lines,
Is it possible to make an regular expression to do this ?

old record...

4701 mc
3011 Theresa W.@Devasahayam!337826528!Theresa W. Devasahayam
4900 01-06-11 18:57:48.000
6501 !333331370!Jamaica
6502 !33334166X!Russia
6503 !333372891!Dutch
7001 31-05-11 : zmcapxl
7100 M 2011 A 1616 \ c

new record...

4701 mc
4900 01-06-11 18:57:48.000
3011 Theresa W.@Devasahayam!337826528!
6501 !333331370!
6502 !33334166X!
6503 !333372891!
7001 31-05-11 : zmcapxl
7100 M 2011 A 1616 \ c

Thanks for helping,
Jan
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Since this was addressed to me, I guess I'm responsible for answering it...

Find what: (.*!).*
Replace with: \1
Nico
Posts: 6
Joined: Thu Oct 02, 2003 2:49 pm

Post by Nico »

Hello ak47wong,

Thanks again! I wanted to type 'now I must...' instead of 'no I must...'

I tried to 'manipulate' your first answer at my first question

Find what: ^(65.*_)!.*!(.*) [replace the underscore with a space]
Replace with: \1\2
[X] Regular expression
Click Replace All

But without succes

(.*!).*
\1

Works for me,I'm very grateful

Greetings from the netherlands
Post Reply