Einzelnen Beitrag anzeigen

Dejan Vu
(Gast)

n/a Beiträge
 
#14

AW: Suche mittels Grep in DFM-Dateien ergibt mitunter "false negative"

  Alt 5. Jul 2014, 15:43
AFAIK arbeitet sed nur zeilenweise.
Ja - und das richtige Tool wäre damit eigentlich tr...

sed: How can I replace a newline (\n)?
Äh, nö. Geht auch ohne. SED schmeißt das \n ja weg, also brauchen wir 'N' (zum zusammenbepseln von zwei Zeilen) und das Pattern \'\+\s*\' (ob das jetzt SED-Syntax ist, weiß ich nicht).
Zitat von SED Manual:
To match a block of two or more lines, there are 3 basic choices:
(1) use the 'N' command to add the Next line to the pattern space;
(2) use the 'H' command at least twice to append the current line to the Hold space, and then retrieve the lines from the hold space with x, g, or G; or
(3) use address ranges (see section 3.3, above) to match lines between two specified addresses.
  Mit Zitat antworten Zitat