hi everyone,
1.txt
981 I field1 > field2.a: aa, ..si01To:<f:a@a.com>From: <f:a@a.com>;tag=DVNgfRZBZRMi96 <f:a@1:333>;ZZZZZ: 12345
the output
field1 field2 <f:a@a.com>
the output is cut the string 3rd and 5th field, and get the value betwee "To:" and "From:", please advice.
Thanks
i know i can
awk 'BEGIN{FS="To:";RS="From:"}/</{print $2}' 1
to get <f:a@a.com>, but how to at the same time get 3rd and 5th field.
This is only way i can figure out, but very not 'smart'
cat 1 | cut -f3,5 -d' ';awk 'BEGIN{FS="To:";RS="From:"}/</{print $2}' 1
but when 1.txt has many lines, then problem
if multiple lines, then i can use cat first, then awk, then paste two files. haha, very not 'smart' solution