how to skip blank line while reading CSV file using python
This is my code i am able to print each line but when blank line appears
it prints ; because of CSV file format, so i want to skip when blank line
appears
import csv
import time
ifile = open ("C:\Users\BKA4ABT\Desktop\Test_Specification\RDBI.csv", "rb")
data = list(csv.reader(ifile, delimiter = ';'))
for line in csv.reader(ifile)):
if not line:
empty_lines += 1
continue
print line
No comments:
Post a Comment