in reply to how to use matching operator on newlines
Slurping can be a problem if your files are large. This one-liner avoids that by using -n instead of -p:
perl -i -ne '/^$/ or print' foo.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to use matching operator on newlines
by sauoq (Abbot) on Jan 03, 2007 at 21:10 UTC | |
|
Re^2: how to use matching operator on newlines
by ikegami (Patriarch) on Jan 03, 2007 at 21:02 UTC | |
by BrowserUk (Patriarch) on Jan 03, 2007 at 21:51 UTC |