I have two csv files a.csv
and b.csv
, both of them come with no headers and each value in a row is seperated by \t
.
1 apple
2 banana
3 orange
4 pear
apple 0.89
banana 0.57
cherry 0.34
I want to subtract these two files and get difference between the second column in a.csv
and the first column in b.csv
, something like a.csv[1] - b.csv[0]
that would give me another file c.csv
looks like
orange
pear
Instead of using python and other programming languages, I want to use bash command to complete this task and found out that awk
would be helpful but not so sure how to write the correct command. Here is another similar question but the second answer uses awk '{print $2,$6-$13}'
to get the difference between values instead of occurence.
Thanks and appreciate for any help.