How to replace/remove first/second character from each line

Find, replace, find in files, replace in files, regular expressions

How to replace/remove first/second character from each line

Postby marino » Fri Jan 07, 2005 7:07 am

I know that I can use column mode but I would like to know how to do it with reg exp. For example:
aaxxxxx
bbxxxxx
ccxxxxx
How to remove aa bb and cc.
Thanks
User avatar
marino
Newbie
 
Posts: 9
Joined: Fri Dec 31, 2004 12:00 am

Re: How to replace/remove first/second character from each line

Postby mrainey56 » Fri Jan 07, 2005 9:25 am

Unix mode:

Find What: ^..(.*)$
Replace With: \1
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: How to replace/remove first/second character from each line

Postby marino » Fri Jan 07, 2005 10:47 pm

Thanks
User avatar
marino
Newbie
 
Posts: 9
Joined: Fri Dec 31, 2004 12:00 am

Re: How to replace/remove first/second character from each line

Postby EllE » Wed Jun 14, 2006 7:16 pm

nice... and exist this for Regular expressions in UltraEdit style???
User avatar
EllE
Basic User
Basic User
 
Posts: 12
Joined: Mon Jun 12, 2006 11:00 pm

Re: How to replace/remove first/second character from each line

Postby Mofi » Thu Jun 15, 2006 1:09 pm

In UltraEdit style:

Find What: %??^(*^)$
Replace With: ^1

Regular expression translations between legacy Unix and UltraEdit style can be easily done with the tables in the help of UE/UES at topic "Regular Expressions" which I have told you already and you hopefully have read it carefully.

Following does the same faster:

Find What: %[~^r^n][~^r^n]
Replace With: nothing
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4064
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Find/Replace/Regular Expressions