Some users have requested this feature.
In order to avoid complete refactoring or introducing more code complexity, a design choice to create temporary files without blank lines is made.
Additionally, an extension check is added and there are multiple smaller code style and structure improvements.
Closes https://github.com/espressif/esp-idf/issues/8421
This fixes the issue where multiline strings and strings with delimiters inside the nvs input csv file were incorrectly parsed, and adds back the ability to add comment lines anywhere in the CSV file.
The issue stems from the move away from the python built in csv module to manual parsing, which was made after moving away from using the csv module to parse mfg data.
This reverts back to using the csv module for parsing and writing csv data in both mfg_gen and nvs_partition_gen, fixes the original issue in mfg_gen and improves code quality which makes the code more readable and maintainable.
Closes https://github.com/espressif/esp-idf/issues/7175