Here is the input(sample):
name1@gmail.com|com.emailclient.account name2@msn.com|com.socialsite.auth.account
I\'m trying to achieve this:>
The awk is ok. I'm guessing the file is from a windows system and has a CR (^m ascii 0x0d) on the end of the line.
This will cause the cursor to go to the start of the line after $2.
Use dos2unix or vi with :se ff=unix to get rid of the CRs.
:se ff=unix