davidverweij / csv2docx

Generates .docx files from .csv files using a .docx template with mailmerge fields
MIT License
5 stars 0 forks source link

Empty rows -> infinite loop? #33

Open davidverweij opened 4 years ago

davidverweij commented 4 years ago

I just used the script and it worked almost flawlessly - nice! I did notice however that the save as .csv functionality in Excel can leave a very large number of empty rows. I am not sure if this was the crux, but the program did not finish, even though all the rows with content (even with empty rows in between) were successfully produced. I'll see if I can debug this behaviour to determine why the program did not finish (and will add the relevant test-cases to our testing suite).

edit

I found 663 hidden .docx files that were generated by empty rows. I'd suggest to embed a check if all fields are present per row, or at least whether some data is present in the row before creating all files. Perhaps an optional setting could allow a 'lossy' or 'strict' execution of such a rule. Also, how do we handle a missing row value?