Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove empty lines from file python

with open("new_file","r") as f:
 for i in f.readlines():
       if not i.strip():
           continue
       if i:
           print i,
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #empty #lines #file #python
ADD COMMENT
Topic
Name
8+3 =