Compare two SAI DB and report in outputted csv file.
zdavatz opened this issue · 0 comments
zdavatz commented
- We need to be able to compare two
sai.db
files and report the difference indate_sai_diff.csv
. date is the day the report was created. - Delimiter of
date_sai_diff.csv
is;
. - running
sai --diff
will result in comparing the contents of the last two month of the files found here: https://sai.refdata.ch/download. Basically twosai.db
are created with the timestamp of the.zip
filename, so i.e.:sai_05102021.db
andsai_05092021.db
. - Then each line between the two dbs is compared to find which cell of each line has changed.
- The output file
date_sai_diff.csv
only contains lines where the content of one or more cells has changed. - The file
date_sai_diff.csv
contains the cell(s) with the changed information. - The header name of the cell of which the content has changed, we print in the first cell of each line of
date_sai_diff.csv
. If several cells of a line have changed, we separate the header names by,
. - Complete new lines are added at the end of the file.
- This only has to work from XSD version 3.0.