Hi I'm having a bit of trouble when using awk to add a column at the start of a .tsv file that i'm creating within a loop.
My code is as follows (can ignore the rest of the loop):
while IFS= read -r line
do
curl *URL.org* > ./folder/$line.tsv
sleep 60
awk '{print "$line\t" $0}' ./folder/$line.tsv > $line.tabbed
done < ./folder/<filetoread>.txt
So basically I have this loop that I'm using to create a tsv file from a curl command, and using the $line variable to create a file with this. The file read is simply a list of single word identifiers;
RUIAHT48
RUIAHT49
etc.
I thought I could use awk to append this $line variable to create a new column in each of the newly created files.
Output before awk command;
$line col1 col2 col3 col4 col5
$line CLV_M 19 25 False False
$line CLV_P 59 63 False False
$line DEG_N 1 3 False False
$line DOC_C 10 14 False False
Desired output;
new col1 col2 col3 col4 col5
<value> CLV_M 19 25 False False
<value> CLV_P 59 63 False False
<value> DEG_N 1 3 False False
<value> DOC_C 10 14 False False
Where the new column is all the same value but the actual value instead of literally just "$line". Where am I going wrong here? Should I actually be using awk or another command with a simpler way?
Thanks :)