Bug fix on import (error messages are back)

Rafael
Rafael M. Martins 7 months ago
parent 0921e8a763
commit f0d2923cb0
  1. 3
      py/import.py

@ -21,7 +21,6 @@ for hus_name in next(os.walk(BASEDIR))[1]:
cards = []
all_txts = sorted(glob.glob(f"{BASEDIR+hus_name}/**/*.TXT", recursive=True))
#print(all_txts)
for txt in all_txts:
card, year, month = os.path.split(txt)[1].split('.')[0].split('-')
@ -103,6 +102,8 @@ for hus_name in next(os.walk(BASEDIR))[1]:
# Sometimes, some of the lines in a file are the wrong size.
# When that happens, we skip the file.
if len(data[-1]) != len(col_names):
print(" - Invalid file format; SKIPPING!")
print(f" - Expected cols: {len(col_names)}; Found cols: {len(data[-1])}")
continue
placeholder = f"({','.join('?' for _ in range(len(data[0])))})"

Loading…
Cancel
Save