Page 1 of 1

Remove all text after a symbol per line

Posted: Tue Nov 10, 2009 10:27 pm
by roonyroo
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

Re: Remove all text after a symbol per line

Posted: Wed Nov 11, 2009 7:06 am
by DataMystic Support
Use a perl pattern search/replace
;[^\r\n]*?
Replace with nothing.

Re: Remove all text after a symbol per line

Posted: Fri Apr 22, 2011 8:02 pm
by roonyroo
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

Re: Remove all text after a symbol per line

Posted: Thu Apr 28, 2011 12:18 pm
by DataMystic Support
Very easy, use an EasyPattern search/replace:

Code: Select all

[ mustBeginWith( ';' ), 1+ characters, mustEndWith('dog' ) ]
Replace with nothing.