Hi,
If the names and addresses in your text file are separated by one or more tabs, you can try this on the *nix command line:
cat <text-file-name> | expand | tr -s " " | cut -d ' ' -f1 > <another-text-file-name>
If the names and addresses in your text file are separated by one or more spaces, you can even try this:
cat <text-file-name> | tr -s " " | cut -d ' ' -f1 > <another-text-file-name>
The first option will work in every case.
-Parul Mathur
-----Original Message----- From: "Dr. Sharukh K. R. Pavri." spavri@vsnl.com Subject: [ILUG-BOM] regexp query Date: Wed, 10 Dec 2003 18:00:26 +0530
I have a text file in the format
Full name email@ddress
It's a pretty long list of names and I want to remove all the email addresses from the file. I basically want to be left with a file with only the names of the persons, one on each line.
I tried :s [a-z]@[a-z] //g in vim but it did not work. It says E59: invalid charcter after @
how can I do this ?
thanks,
Sharukh.
On 11/12/03 09:25 +0530, Parul.Mathur wrote:
Hi,
If the names and addresses in your text file are separated by one or more tabs, you can try this on the *nix command line:
cat <text-file-name> | expand | tr -s " " | cut -d ' ' -f1 > <another-text-file-name>
tr -s works fine for any whitespace other than IFS.
Try this input: Devdas Bhagat devdas@dvb.homelinux.org Philip S Tellis philip@ncst.ernet.in Parul Mathur parul.mathur@india.rsystems.com Dr. Shahrukh K. R. Pavri sparvi@vsnl.com
Devdas Bhagat