Remove all text after a symbol per line

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

roonyroo
Posts: 2
Joined: Tue Nov 10, 2009 10:16 pm

Remove all text after a symbol per line

Postby roonyroo » Tue Nov 10, 2009 10:27 pm

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

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Remove all text after a symbol per line

Postby DataMystic Support » Wed Nov 11, 2009 7:06 am

Use a perl pattern search/replace
;[^\r\n]*?
Replace with nothing.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

roonyroo
Posts: 2
Joined: Tue Nov 10, 2009 10:16 pm

Re: Remove all text after a symbol per line

Postby roonyroo » Fri Apr 22, 2011 8:02 pm

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

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Remove all text after a symbol per line

Postby DataMystic Support » Thu Apr 28, 2011 12:18 pm

Very easy, use an EasyPattern search/replace:

Code: Select all

[ mustBeginWith( ';' ), 1+ characters, mustEndWith('dog' ) ]

Replace with nothing.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 1 guest