Title: UNIX help needed for sed multi-line pattern space

If I have the following two-line sql statement in a file:

SELECT A,B,C FROM TABLE1
WHERE A=1;

and want to create a single line, I could use the following sed script:

/[^;]$/{
 N
 s/\n/ /
}

which would produce:

SELECT A,B,C FROM TABLE1 WHERE A=1;

What would my sed script look like if there were 2, 3, or even 4 continuation lines (unknown number of lines)?
Note that the file is too large for vi.
Any good UNIX sites where I could post UNIX questions?

Thanx,

Alan Martin
Principal Consultant
Defense Logistics Information Service
[EMAIL PROTECTED]


Reply via email to