Created
October 15, 2017 19:56
-
-
Save beettlle/b5684e5db48d8f50967c926450122079 to your computer and use it in GitHub Desktop.
Convert Mint output to something useful to me
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
with open("./transactions.csv", 'rb') as csvfile: | |
with open("./transactions2.csv", 'wb') as csvfile2: | |
fileread = csv.reader(csvfile, delimiter=',', quotechar='"') | |
filewrite = csv.writer(csvfile2, delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL) | |
for row in fileread : | |
if row[3] != 'Amount' : | |
row.append(row[3] if row[4] == 'credit' else str(float(row[3])*-1)) | |
else: | |
row.append("Calculated Amount") | |
filewrite.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment