We have encountered issues with CSV files containing quoting problems, such as unclosed quotes or inconsistent use of quote characters. These issues cause parsing errors when using pandas or Python's built-in CSV reader.
Create a script that includes the following functionality:
- Attempts to parse each row of a csv using CSV reader and reports malfunctioned rows.
- Scans each line for an odd number of quote characters, which may indicate quoting issues
Ideally, these scripts can be used to detect issues from the created csv files (one for each childcare center or school). Should issues be detected, in one or both of the above, the file issues can be remediated.
In a future issue, a logging system should be implemented to create a record of when files have these issues, and how often they occur.