The file abc.af looks like this:
R1211566974^M F<fettle@333empire.com>^M T<gwensadler@vp.dk>^M
The following extracts the two email addresses:
cat abc.af |perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' fettle@333empire.com gwensadler@vp.dk
If you have a list in a textfile:
abd def ghi
You want to make into:
abc def ghi
Do this:
cat /tmp/textfile |tr "\n" " " > /tmp/textfile.withoutnewlines.txt
This command substitute newlines (ā\nā) with spaces (ā ā) and send it to the file textfile.withoutnewlines.txt
tdd@host:~/bin$ echo "http://domain.tdl/xx.?=0/ff" |awk -F '/' '{print $3}' domain.tdl tdd@host:~/bin$