| 14 |
|
|
| 15 |
|
if __name__ == '__main__': |
| 16 |
|
mainPath = '/home/nino/Nextcloud/Nino And May/Fin/Amanda To-Do' |
| 17 |
< |
mainCSV = 'Done 21.csv' |
| 17 |
> |
mainCSV = 'Done 45.csv' |
| 18 |
|
|
| 19 |
|
outputFile = open(os.path.join(mainPath,"DoneLedger.txt"),'w') |
| 20 |
|
#contents = open(os.path.join(mainPath,mainCSV)).readlines() |
| 21 |
|
## Removing headder row |
| 22 |
|
#contents = contents[1:] |
| 23 |
< |
with open(os.path.join(mainPath,mainCSV), 'rb') as csvfile: |
| 23 |
> |
with open(os.path.join(mainPath,mainCSV), 'rt', encoding='ASCII') as csvfile: |
| 24 |
|
reader = csv.DictReader(csvfile) |
| 25 |
|
for row in reader: |
| 26 |
< |
outputFile.write(row['Posted_Date']+ " "+row['Payee'] + "\n") |
| 26 |
> |
outputFile.write(row['Posted_Date']+ " * "+row['Payee'] + "\n") |
| 27 |
|
if row['Other_Notes']: |
| 28 |
|
outputFile.write(" ; " + row['Other_Notes'] + "\n") |
| 29 |
|
outputFile.write(" "+row['Category']+ " "+row['Amount']+ "\n") |