add argument to home converter
This commit is contained in:
parent
f114faf2d2
commit
094dfd9b4c
17
convert.home.py
Normal file → Executable file
17
convert.home.py
Normal file → Executable file
@ -1,3 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import fs
|
||||
import csv
|
||||
|
||||
@ -106,12 +109,12 @@ def convert(row):
|
||||
|
||||
return row
|
||||
|
||||
def main():
|
||||
def main(inputFile):
|
||||
global Keys
|
||||
rows = []
|
||||
csv.register_dialect('2004', delimiter=';', quoting=csv.QUOTE_ALL)
|
||||
csv.register_dialect('new', delimiter=',', quoting=csv.QUOTE_NONE)
|
||||
with open('input.csv', mode ='r') as file:
|
||||
with open(inputFile, mode ='r') as file:
|
||||
imp = csv.reader(file, 'new')
|
||||
|
||||
headers = False
|
||||
@ -200,7 +203,15 @@ def main():
|
||||
# yield parseRow(row, headers)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
print(sys.argv)
|
||||
|
||||
if (len(sys.argv) == 2):
|
||||
main(sys.argv[1])
|
||||
else:
|
||||
print("please use one orgument for the path to the imputfile")
|
||||
# if __name__ == '__main__':
|
||||
# main()
|
||||
|
||||
|
||||
# "Datum";"Naam / Omschrijving";"Rekening";"Tegenrekening";"Code";"Af Bij";"Bedrag (EUR)";"Mutatiesoort";"Mededelingen";"Saldo na mutatie";"Tag"
|
||||
|
||||
Reference in New Issue
Block a user