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
continuelacks indentation.string objects don't have
emptymethod.to check if string
mystrempty can issueif mystr == ''orif not mystrbecause empty strings evaluatefalsein boolean context.
example code:
for line in open('filename'): line = line.strip() if line: print(line)
Comments
Post a Comment