I've a tab/space delimited file as:
31000BL 50014_10011
25467BL 50050_10003
47406BL 50001_10015
40831BL 50114_10006
40830BL 50114_10009
Two columns. I use a while loop to read this:
while read LINE; do
printf "$LINE\n"
old=($(echo $LINE | awk '{print $1}'))
new=($(echo $LINE | awk '{print $2}'))
ll=$old'^V<tab>'$new #I need to work here.
printf "$ll\n"
done < update_ids.txt
The output I'd like is
31000BL\t50014_10011\n25467BL\t50050_10003\n
There is a literal tab and new line character. I cannot concatenate or print with tab and/or new line character.
$0=$0
in the first example. – Lesmana Jan 28 '19 at 16:27awk
to re-form the current record, which means that the value ofOFS
would not be inserted between the fields. – Kusalananda Jan 28 '19 at 16:49$1=$1
causes rewriting of$0
withOFS
. here is an explanation: https://stackoverflow.com/a/41941143 thank you. – Lesmana Jan 28 '19 at 21:28