in reply to perl.exe not functioning?
If the files are not too large, you can ofcourse slurp them entirely into memory and then do the substitution: perl -0777 -pi.bb -e 's/\n\n/\n/g' filename (that's a zero, not an o)
otherwise you'll need a bit smarter script, like: perl -pi.bb -e '$p&&s/^\n//;$p=/^\n/'
BTW, if you just want to filter out blank lines, you can do: perl -pi.bb -e 's/^\n//' (which is like doing perl -0777 -pi.bb -e 's/\n+/\n/g' except more efficient)
|
|---|