Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
remove empty lines from file python
Simba
Programming language:
Python
2021-06-07 10:04:57
0
Q:
remove empty lines from file python
Darryl
Code:
Python
2021-02-03 06:55:44
with open("new_file","r") as f: for i in f.readlines(): if not i.strip(): continue if i: print i,
0
Tags
line
python
file
remove
empty
Related
python remove spaces
regular expression to remove space python
python remove lines of string
how to delete everything on a file python
remove all whitespace from string python
python strip newline from string
remove from string python
remove empty strings from list python
remove spaces from string python
removing spaces in a string python
remove last line of text file python
txt file duplicate line remover python
python string remove whitespace and newlines
python delete duplicate lines in file
remove extra spaces python
New to Communities?
Join the community