I have a text file as shown below. I would like to subtract the numbers in the first column and add a new column with the calculated values(absolute value) to the input files instead of printing the output. How can I do this for multiple files with awk or sed?
46-104 46 3.95073
46-46 46 1.45997
50-50 50 1.51589
52-100 52 4.16567
desired output
46-104 46 3.95073 58
46-46 46 1.45997 0
50-50 50 1.51589 0
52-100 52 4.16567 48