I have 2 csv files like:
format
- REPORT_NUM,EXEC,REPORT_NAME,REPORT_COUNT
before.csv
- 1,1,"Report 1",45
- 2,1,"Report 2",456
- 3,1,"Report 3",11
- 4,1,"Report 4",0
after.csv
- 1,1,"Report 1",47
- 2,1,"Report 2",456556
- 3,1,"Report 3",0
- 4,1,"Report 4",212
I basically need for each REPORT_NUM to compare REPORT_COUNT and then output a 3rd csv with REPORT_NAME,before REPORT_COUNT, after REPORT_COUNT when there's a threshold cross ( when the after is more than 10% different to before ) . EXEC is just an execution run.
So result.csv might show:
- 2,1,"Report 2",456,456556
- 3,1,"Report 3",11,0
- 4,1,"Report 4",0,212
I am looking at the following for inspiration:
Comparing values between 2 CSV files and writing to a 3rd CSV file
Python: Comparing two CSV files and searching for similar items
I continue to search ,but any feedback appreciated.
Thank you in advance!
p.s. I am assuming Python is best , I dont mind what language but I have basic python understand. I started writing this in bash and using "diff" and "sed" .. and so I may go that route..