Hi,
I am new to unix.
I have a file with records like the below
ads-sap-4.txt: </a></b></span><span class="linkbutton yellow_but"><a id="2005754_more" style="cursor
ointer; cursor:hand;" onclick="toggle(2005754,'training@smtworks.com','0017329858800','732-985-8800',1,2005754,1);">
I want to scan for e-mail address which is 'training@smtworks.com' and phone '732-985-8800' in the above records and write only these two values to a new file comma separated.
I have about 1000 records each with different e-mail and phone numbers.
I know grep is used to scan for a string in Unix. But how can i grep for @ but grab the whole e-mail address? Also how can a scan for a pattern like the phone number as above? I want to write the above two fields only to a file.
Thanks for your help.