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

Re: [K12OSN] Help with sed script!



Timothy Legge wrote:

cat filename | perl -lp0e 's/DC=LO\n.*CAL/DC=LOCAL\n/g'

will combine the lines (if the break is at LO)

sed operates only on one line at a lime.  Perl in paragraph mode can
combine the lines...

Sed does have a way to do things like that with hold and get operations across multiple lines, but the syntax is fairly insane compared to perl. And sed is another program where you need to use info instead of man for the real documentation - or google for sed and holding space for some examples.

--
  Les Mikesell
   lesmikesell gmail com


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