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 issue if mystr == '' or if not mystr because empty strings evaluate false in boolean context.

example code:

for line in open('filename'):     line = line.strip()             if line:         print(line) 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -