If you have extra lines at the end of a csv file it causes this error
$ ./icsv2ledger.py -a amex amextest.csv amextest.txt
Traceback (most recent call last):
File "./icsv2ledger.py", line 631, in <module>
main()
File "./icsv2ledger.py", line 628, in main
process_input_output(options.infile, options.outfile)
File "./icsv2ledger.py", line 610, in process_input_output
ledger_lines = process_csv_lines(csv_lines)
File "./icsv2ledger.py", line 621, in process_csv_lines
options)
File "./icsv2ledger.py", line 314, in __init__
self.date = fields[options.date - 1]
IndexError: list index out of range
It seems like a common enough mistake that there should be some way to handle it, either to ignore blank lines and throw a warning, or stop if there are blank lines at the end of a csv file and show a message that they need to be removed.
If you have extra lines at the end of a csv file it causes this error
It seems like a common enough mistake that there should be some way to handle it, either to ignore blank lines and throw a warning, or stop if there are blank lines at the end of a csv file and show a message that they need to be removed.