On Friday 05 December 2003 09:15, adam beecher wrote:
> For some reason an extra linefeed or line break got introduced into some
> pages in a clients site, anyone got any suggestions for how to get rid of
> em? I'm guessing I should be using something like sed, but I have no idea
> how. Here's a couple of pages with the problem:
perl -0777 -pi -e 's/\r\n\r\n/\r\n/g' <FILENAME>
will do what you want. It's left as an exercise for the reader to decide how
to apply this to a lot of files, but it's a piece of cake.
It's left as a further exercise for the curious reader to find out what this
is doing - man perlrun will help.
Perhaps if you avoid cruddy Windows tools you'll avoid this problem in the
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!