Created
June 30, 2011 17:28
-
-
Save yosemitebandit/1056718 to your computer and use it in GitHub Desktop.
process a csv, write to another csv
This file contains hidden or 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
input_data = open('data.csv', 'r') | |
output_data = open('out.csv', 'w') | |
for line in input_data: | |
data = line[0:-2] # snip off the new line character and trailing comma | |
output_data.write( data + '\n' ) # add the newline back | |
input_data.close() | |
output_data.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment