excel - Mass deleting white spaces with very large data arrays -
so dled csv hthat large use mass delete found on internet. how can rid of white spaces located between each data point. can use python , had suggested like:
for line in open('filename'): line = line.strip() if line.empty(): continue print line
yet when try "empty" function doesn't seem work. either through python or other way, got rid of these white spaces. thanks!
some pointers:
line.strip()
removes whitespace @ beginning , end of line - want? if want whitespace removed,line = ''.join(line.split())
.your
continue
lacks indentation.string objects don't have
empty
method.to check if string
mystr
empty can issueif mystr == ''
orif not mystr
because empty strings evaluatefalse
in boolean context.
example code:
for line in open('filename'): line = line.strip() if line: print(line)
Comments
Post a Comment