I have a regularly appended CSV file with two types of similar data. I can't control how the data come into the CSV - but I want to execute a python script that will format the CSV so that I can ingest it into a database. Here is what I want to do:
Incoming raw data look like this:
record, date & time, sensor, height, status
record, date & time, sensor, height, weight, status
The idea would be to just take these data iteratively add a comma after height if no weight or something like that. Essentially mimic a blank field so that the data would essentially look like this:
record, date & time, sensor, height, **weight,**status (updated after python script if/then)
record, date & time, sensor, height, weight, status
Hopefully that makes sense - Basically adding a field and I would run the script every time the file is updated.