LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-01-2005, 10:14 AM   #1
wally.nl
LQ Newbie
 
Registered: Nov 2005
Location: Netherlands
Posts: 3

Rep: Reputation: 0
Question Bulk replace email addresses with SED ?


Hi,

Recently we 'reshuffled' our mailservers so a lot of email addresses have changed. There are still a lot of old adresses on our websites. We do have a list with all 'new@address.com' - 'very@old.address.com' translations. Is it possible to use sed with this list to replace all old addresses in the html pages or would this require more serious programming ? I can reformat this list without any problems if it needs to be in a specific format/use specific delimiters.

Thanks,

Wally.nl
 
Old 11-01-2005, 10:42 AM   #2
naf
Member
 
Registered: Oct 2005
Location: Chicago, USA
Distribution: Slackware & Fedora
Posts: 66

Rep: Reputation: 15
Create a sed script such as conv.sed (one conversion per line):
Code:
s/alpha@who\.com/nalpha@whom\.com/g
s/beta@who\.com/ralph@harry\.com/g
s/gamma@who\.com/ford@cork\.org/g
s/old/new/g
You have to escape the periods to avoid regular expression interpretation.
Then run the command:
Code:
sed -f conv.sed yourfile.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I replace this string with another using sed? dave4545 Programming 7 01-27-2006 10:58 AM
Replace substring with SED marri Programming 2 07-09-2005 05:18 PM
[sed] replace string? chuanyung Programming 3 03-11-2004 08:42 PM
Bulk email - scared of being accused of spamming. GuitsBoy General 3 11-14-2003 03:14 PM
Sed - suitable to replace CR LF? J_Szucs Programming 3 05-12-2003 06:03 PM


All times are GMT -5. The time now is 09:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration