suing sed to remove certain list of strings from a file ???
Linux - DistributionsThis forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...
Note: An (*) indicates there is no official participation from that distribution here at LQ.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
suing sed to remove certain list of strings from a file ???
Hello there,,
i want to know how can i use sed to remove a list of emails from my email list ?? please can anyone help me to do that ??
example :
- i have fileA & fileB
- fileA contain a list of emails (say 7 emails), while fileB contain 300 email (including the 7 emails in fileA)
- now i want to make fileB doesnt contain the list of emails in fileA (which are 7 emails)
any help will be appretiated ,,
may all accept my best regards,,
Last edited by HuMan-BiEnG; 09-28-2010 at 02:32 PM.
You want to sue sed? What have they ever done to you?
But seriously, could you provide some actual examples of the text you want to remove? It's almost impossible to give clear advice when we have only vague descriptions to work with.
Finally, how do you know that sed would be the best tool for the job? It's usually better to simply explain what you want to accomplish, and leave the how to be determined in the discussion.
You want to sue sed? What have they ever done to you?
But seriously, could you provide some actual examples of the text you want to remove? It's almost impossible to give clear advice when we have only vague descriptions to work with.
Finally, how do you know that sed would be the best tool for the job? It's usually better to simply explain what you want to accomplish, and leave the how to be determined in the discussion.
Hello David,
ictually you are write, about the tool of program that will help me to finish what i want ,,
diff fileA fileB | sed -n '/.com$/p' | sed 's/^> //' > file
mv file fileB
Warm Regards,
just doing a diff could mask all sorts of things. What if the addresses are not in the same order? why only .com suffix domains? why manually strip out the diff formatting instead of using proper formatting in the first place?
just doing a diff could mask all sorts of things. What if the addresses are not in the same order? why only .com suffix domains? why manually strip out the diff formatting instead of using proper formatting in the first place?
Hi,
I just tried to strip off the characters and lines other than required.
In the below output I needed to eliminate lines other than email address.
Also > character.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.