Hi everyone,
I have a file containing one column and I want to subtract the first value (value of first line) from each line's value.
79304
99299
119294
139289
159284
179279
199274
219269
239264
259259
279254
299249
319244
339239
359234
I tried working on an awk solution with first defining the variable for the value of the first line
awk D='NR==1' pulse_time.txt
and then subtracting this from the first column of the file
awk '{print $1 -D}' pulse_time.txt
But unfortunately it fully ignores the D in that case.
I also tried to find a shell solution by defining the variables and then subtracting them. But it doesn't do what it should (subtraction incorrect).
S=$(head -1 pulse_time.txt)
OP=$(cat pulse_time.txt)
$(($OP-$NM))
Any help would be highly appreciated!
many thanks in advance!