in reply to how to use matching operator on newlines
perl -p reads a line at a time, so it never sees any more than one \n at once. Try this:
perl -pi -e 'BEGIN{undef $/} s/\n\n/\n/g;' foo.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to use matching operator on newlines
by extremely (Priest) on Jan 03, 2007 at 21:19 UTC | |
by ikegami (Patriarch) on Jan 03, 2007 at 21:37 UTC | |
by kyle (Abbot) on Jan 03, 2007 at 21:44 UTC | |
|
Re^2: how to use matching operator on newlines
by redss (Monk) on Jan 03, 2007 at 20:56 UTC |