I have a problem I have been trying to figure out:
We have a stock file CSV, which contains the stock in multiple locations.
The csv looks like this:
stock_no,primary,secondary,tertiary,cstock,direct ABU0029843,1,,,5, ABU0029934,60,,,5, ABU0030034,,30,,5,
I would like the end result to look something like this (essentially summing up and removing the empty columns.)
stock_no,primary ABU0029843,6 ABU0029934,65 ABU0030034,35
I have tried various methods with awk, but I seem to be returning values of 0
However, I am not too familiar with awk, so I am sure I am doing something wrong. Any help would be appreciated.