Now I added an option for gzipping the output file. It seems to work and when I leave out whitespaces at the same time, I get a 5KiB file (original: 190KiB) instead of 25KiB (without gzipping).
I also corrected the line separator (it’s chosen automatically now, instead of using “\n”, which doesn’t work on Windows).