(Note: this question is heavily shortened because the detailed question was blocked with "This looks like spam.")
I'm having a hard time adding missing lines to a series of data in a semicolon separated csv-file with awk/gawk.
Sample data (csv)
date;city;gender;status;value
2019-10;New York City;women;AL;5
2019-10;New York City;women;SC;2
2019-10;New York City;men;AL;3
2019-10;New York City;men;SC;1
2019-12;New York City;men;AL;5
2019-12;New York City;men;SC;3
2020-01;New York City;women;AL;8
2020-01;New York City;men;SC;2
Goal
For every year (beginning with the first year that appears in the file (here "2019") and ending with the last year that appears in the file (here "2020")) and month (beginning with the first month that appears in the file (here "10") and ending with the last month that appears in the file (here "01")) there should be 4 lines.
The example data for the month "2019-10" show a correct occurence of the data I need:
4 lines for each month of a year, 2 for women, 2 for men each with status AL and SC.
Desired output
date;city;gender;status;value
2019-10;New York City;women;AL;5
2019-10;New York City;women;SC;2
2019-10;New York City;men;AL;3
2019-10;New York City;men;SC;1
2019-11;New York City;women;AL;0
2019-11;New York City;women;SC;0
2019-11;New York City;men;AL;0
2019-11;New York City;men;SC;0
2019-12;New York City;women;AL;0
2019-12;New York City;women;SC;0
2019-12;New York City;men;AL;5
2019-12;New York City;men;SC;3
2020-01;New York City;women;AL;8
2020-01;New York City;women;SC;0
2020-01;New York City;men;AL;0
2020-01;New York City;men;SC;2
Missing lines should get value 0. The original data also includes occurences without a month-line (either for women or men or even no line is delivered).
Any help is greatly appreciated.
As this is my first post on this platform and I'm not natively english speaking please forgive any mistakes I made.