I'm trying to convert a multilined file to a single line separated by colons and then "chomp" off the last colon..
I got this so far:
but the sed portion isn't working correctly.. with the sed it deleted the entire line.. I just want the trailing colon to be deleted.
example:
U02313
U03029
U02593
U02100
U03023
U02787
Output should look like:
U02100:U02313:U02593:U02787:U03023:U03029
Thanks
I got this so far:
Code:
cat tapes_111.txt | grep U0[2-3]'*' | awk '{print $1}' | sort | awk -vORS=':' '{ print }' | sed -e 's/.$//'
but the sed portion isn't working correctly.. with the sed it deleted the entire line.. I just want the trailing colon to be deleted.
example:
U02313
U03029
U02593
U02100
U03023
U02787
Output should look like:
U02100:U02313:U02593:U02787:U03023:U03029
Thanks