Computing.Net > Forums > Unix > sed script ??

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sed script ??

Reply to Message Icon

Name: peter
Date: September 11, 2003 at 07:37:45 Pacific
OS: win
CPU/Ram: 512
Comment:

Hi all ... I feel kind of dumb asking this .. but for some reason I can not figure it out.

if I had an email addreess of the following format

firstname.lastname@caompany.com
I need to get the first letter from the first name and append it to the last name, and then put the new word in front of the email address

so you would have

newword emailaddress

anyone know how to do this ?



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: September 12, 2003 at 04:36:14 Pacific
Reply:

sed -e 's/@.*$//' -e 's/\(^.\).*\.\(.*\)/\1\2/'


0

Response Number 2
Name: Sean Miller
Date: September 15, 2003 at 03:23:39 Pacific
Reply:

Are you saying something like...

sean.miller@mydomain.com
=> millers@newdomain.com ?

If so, the above needs to be "tweaked" to say...

sed -e 's/@.*$//' -e 's/\(^.\).*\.\(.*\)/\2\1\@newdomain.com/'

Sean


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: sed script ??

need help on SED script www.computing.net/answers/unix/need-help-on-sed-script/7487.html

sed script www.computing.net/answers/unix/sed-script/6713.html

sed script www.computing.net/answers/unix/sed-script/8452.html