Archive: Delete blank lines from a text file?


Delete blank lines from a text file?
I am trying to delete all the blank lines from a text file selected by a user. I can get the dialog where user can browse and select the file, but how can I detect and delete the blank lines?
I found a text manipulation example here, but don't know where to start:
http://nsis.sourceforge.net/archive/....php?pageid=17


In that script, replace "line to replace$\r$\n" with "$\r\$n" and "replacement of line$\r$\n" with "" and you're good to go.


kichik, your code worked great after switching a couple of transposed characters from "$\r\$n" to "$\r$\n" (I do that all the time).

Thanks for the help! :up: