Using Python, How To Remove Whole Line In Csv File If Specific Character Is Present In This Line?
I have large csv file, 216961 lines: 9808,54,43,59,999,17,10,59,999,-1,0,0 9809,54,43,59,999,17,12,0,-1,0,0 9810,54,43,59,999,17,13,0,001,-1,0,0 9811,54,43,59,999,17,13,59,999,-1,0
Solution 1:
Try this approach.
import csv
reader = csv.reader(open("file.csv", "rb"), delimiter=',')
for line in reader:
if"-1"notin line:
print line
Post a Comment for "Using Python, How To Remove Whole Line In Csv File If Specific Character Is Present In This Line?"