Switching from localhost to nodejs and express

Hmm. Honestly, I think that is a good solution – to assume that lines could be empty and handle them correctly. Among other things, ending linebreak is POSIX standard, so if you get your rows by splitting on linebreaks then this should happen with valid files. That meanss you either handle it while looping, or you handle it before looping (for example, just checking the last row and trimming it if empty).

1 Like