What I have
Hi, imagine a lot of this files, where first column is epoch, and the other(s) column(s) are some data:
1000333,34,1
1001456,56,0
1005356,34,2
What I need
I need to transform them into this:
0,34,1
1123,56,0
5023,34,2
The above first column numbers come from:
1000333 - 1000333 = 0
1001456 - 1000333 = 1123
1005356 - 1000333 = 5023
Context
Those files are into several folders into a big folder called logs_swapoff
, they end with _times.csv
(there are another csv
s in those folders that must not be touched).
Examples of files:
logs_swapoff/folder1/modifyMe_times.csv
logs_swapoff/folder1/dontTouchMe_cores.csv
logs_swapoff/folder2/modifyMeToo_times.csv
I am planing to use this loop in bash, but I don't know how to do the task itself.
for filename in $(find logs_swapoff/* -name '*_times.csv') ; do
# filename without extension (to write the output with a similar name?)
fname=$(dirname $filename`"/"`basename -s .csv $filename);
?????
done;
Thanks guys :)