hi,
I was wondering how to remove all text after the character ; for everyline
Basically atm i have ie., sdfsfs; 1234c
asdasd; 987b
i need it to look like this sdsfs
asdasd
basically remove everything after ; for each line
thanks
Remove all text after a symbol per line
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Remove all text after a symbol per line
Use a perl pattern search/replace
;[^\r\n]*?
Replace with nothing.
;[^\r\n]*?
Replace with nothing.
Re: Remove all text after a symbol per line
is it possible to state the word to end at across multiple lines?
start at ; & remove everything until all lines in between until it hits the word dog?
;cat dfgdgdgdg
dfgdfgdg
dfg
dfgdfg
dfg dog
so it ends up as
;dog
thnx
start at ; & remove everything until all lines in between until it hits the word dog?
;cat dfgdgdgdg
dfgdfgdg
dfg
dfgdfg
dfg dog
so it ends up as
;dog
thnx
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Remove all text after a symbol per line
Very easy, use an EasyPattern search/replace:
Replace with nothing.
Code: Select all
[ mustBeginWith( ';' ), 1+ characters, mustEndWith('dog' ) ]