Hi!
I really need your help!
I need to operate the columns separate by ',' of a file with this structure
a1,a2,a3
b1,b2,b3,b4,b5
c1,c2
d1,d2,d3
e1
....
and I want the result of this subtractions
a1-a1,a2-a1,a3-a1
b1-b1,b2-b1,b3-b1,b4-b1,b5-b1
c1-c1,c2-c1
d1-d1,d2-d1,d3-d1
e1-e1
For example, if the file is
43805414,43805643,43805660,43805688,43805771,43805788,43805876,
116842150,116844494
117072160,117072559,117073456
115850458,115850499,115650901,115651050
115538171,
The desired result would be
0,229,246,274,357,374,462
0,2344
0,399,1296
0,41
0
I'm a beginer at awk, I tried this code
awk -F, '{print $1-$1, $2-$1, $3-$1, $4-$1, $5-$1, $6-$1, $7-$1}' ./InputFile
But the numbers of columns is variable, some lines has many columns and I don't want the negative results. Besides, if it possible, I want the output separate by ','
Thanks a lot!!!!!!!!!