Permalink
Browse files

Update projects/fdic/save_to_csv.py

Changed delimiter; substituted writerows for loop
  • Loading branch information...
1 parent 60eecf6 commit 9e539c7d892df439c8c89763c9478e86cac2aaf2 @cschnaars cschnaars committed Feb 21, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 projects/fdic/save_to_csv.py
View
8 projects/fdic/save_to_csv.py
@@ -86,12 +86,12 @@ def convertdatestring(datestring):
row['updated'] = ''
with open(savedir + 'fdic_output.txt', 'w') as outputfile:
- wtr = csv.DictWriter(outputfile, delimiter= '|', fieldnames=outputheaders,
- lineterminator = '\n')
+ wtr = csv.DictWriter(outputfile, delimiter=',', fieldnames=outputheaders,
+ lineterminator='\n', quotechar='"', quoting=csv.QUOTE_NONNUMERIC)
# Add headers to output
wtr.writeheader()
- for row in data:
- wtr.writerow(row)
+ # Write the data
+ wtr.writerows(data)

0 comments on commit 9e539c7

Please sign in to comment.