Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: KATE: Finding & replacing multiple newlines

  • Subject: Re: KATE: Finding & replacing multiple newlines
  • From: Roy Schestowitz <newsgroups@xxxxxxxxxxxxxxx>
  • Date: Sat, 24 Dec 2005 08:25:44 +0000
  • Newsgroups: comp.windows.x.kde
  • Organization: schestowitz.com / MCC / Manchester University
  • References: <43acc1f4$0$59169$892e7fe2@authen.yellow.readfreenews.net>
  • Reply-to: newsgroups@xxxxxxxxxxxxxxx
  • User-agent: KNode/0.7.2
__/ [joe] on Saturday 24 December 2005 03:35 \__

> I am not sure whether this newsgroup is the right one to ask for help on
> this topic but since KATE is part of KDE and there wasn't any groups or
> forums dedicated to KATE (lots of groups dedicated to Kate Moss however :))
> So after donning my flameproof underwear, I decided to go ahead and ask
> anyway.
> 
> I have just started using KATE and have read all the Fine Manuals :) but I
> simply could not perform a seemingly simple task of replacing 2 consecutive
> newlines (0x0a or \n) with just one single newline. After trying various
> search strings using regular expressions and failing miserably I come to
> the point where I am starting to wonder whether this task is at all
> possible with KATE. Are there any KATE users out there that face the same
> problem? Is there any solutions?

I had the reverse (in /some/ sense) problem: Converting /n into a newline,
i.e. newline stuffing rather than depletion. If someone proposes a solution,
I'd be very interested to hear it. Sorry to have replied without providing a
solution, but the point to make is that I could not find a solution either.
I don't think 'sed' would do the job either, but it might. Let me think
about it and have a go. How about:

   sed 's/\n\n/\n/i;' file_before > file_after

I haven't run it on some test data yet. I hope it helps somehow... maybe
someone could confirm or complete a solution.

Happy holidays...

Roy

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index