I have 169 CSV files with an identical structure (90 columns with the same headers) and an identical naming system.
The files are named as such:
- 2019-v-1
- 2019-v-2
- 2019-v-3
- etc.
For each CSV, I would like to add a column, with the header 'Visits', and for the value in that column to be taken from the file name (the number at the end, after the second dash).
So, for example, the first CSV will have a new column called 'Visits', where every row is given the value '1' in that column.
If there is a Python solution, that would be amazing. I don't come from a coding background, and that's the only language I've got somewhat familiar with, but I can't seem to figure this one out myself.
Any help would be massively appreciated - thank you!