[ILUG] replacing mult. newlines

Matthew Sammon sammonm at tcd.ie
Tue Oct 5 18:17:00 IST 1999


Hi,

Just a quick question:

How do I replace newlines with something else in multiple
files, preferably using awk or sed?

I need to replace:
FOO
: BAR

with:
FOO: BAR

I have tried using gsub(/\n:/,":"), gsub(/\n$:/,":"), gsub(/\n$^:/,":")
and gsub(/\n^:/,":") within an awk script, doesn't work tho.

TIA

Matthew


Matthew Sammon  | 
Yr2 CompSci TCD |
sammonm at tcd.ie  |





More information about the ILUG mailing list