I've seen some threads on this, but none seem to be simple. I'm looking for a simple code to remove the blank rows in a CSV using python.
Asked
Active
Viewed 1,372 times
1 Answers
1
Alternatively (to the duplicate question) you can consider using grep
grep -Pv ^,*$ input_file.csv > output_file.csv
e.g. any line in input_file.csv
that is not either blank or solely composed of commas get redirected to output_file.csv

Adam Smith
- 52,157
- 12
- 73
- 112