Link to home
Start Free TrialLog in
Avatar of shahrahulb
shahrahulb

asked on

file

i have a file containing data in following format

email,username,date

i want to creat a file containing just the email address

i know how to do by opening file, reading .....

is there a simple way of doing that using some unix commands in my perl script
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shahrahulb
shahrahulb

ASKER

ya, u understood me correctly.....let me try this....
It worked!!!!

thanks.
Avatar of ozo
But it won't work if you have a directory named "s" containing a directory that starts with ",."
Ozo's right, of course. Sloppy quoting on my part:

system "sed -e 's/,.*//' $existingfile >$newfile";