Can VI Do This?? Delete before a character in text - Maybe advanced.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
What I want to know is, is there a command that will go through the entire list (over 1000 lines) and delete all characters before the @ symbol? Since they are of different lengths, I can't do a simple search and delete/replace. Anyways, I don't know if it's possible, but if it is, I imagine this would be the place for the answer. Google didn't provide me with a definitive answer, so I thought I'd check here. Thank you in advance!
Are you using vi or vim? Vim might have a magic setting, in which case you donít need to escape the @ at all just plain:
P.S. whatís Scine?
I'm using vi. I tried your code, and it did work somewhat. It brought my email list from email@example.com to microsoft.com. However, I found a bit of tinkering with your code and got it to work. I used this and it worked perfectly.
Thank you very much for the info! Although I must admit, my "sed" abilities aren't where I'd like them to be. I've been running linux for the better part of a few years now, and I'm comfortable with many aspects of it, I must admit that I'm not too familiar with some more popular parts such as sed and awk. But I did notice this particular bit of knowledge helped me out in another area of my project. Thank you very much!
As a side note, to do the opposite, that is to delete everything past a certain character, I used %s/com./com That would replace firstname.lastname@example.org=username@#$@#$ with email@example.com It was a part of a project I'm working on, but thought I would mention it to help other people out.