Created
August 14, 2015 22:06
-
-
Save mayhewsw/ec3a74f7821bf396b83c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if len(sys.argv) != 2: | |
print "Usage: python nospaces.py <inputfile>" | |
exit() | |
infile = sys.argv[1] | |
print "Removing the spaces from " + infile + "..." | |
outfile = "nospaces.txt" | |
out = open(outfile, "w") | |
with open(infile) as f: | |
for line in f: | |
out.write("\t".join(map(lambda s: s.strip(), line.split("\t"))) + "\n") | |
out.close() | |
print "Resulting file is called " + outfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment