On 09.01.2011 21:04 "George Keller" wrote:
>
> I don't need a NL between each record. The fields within
> the records are delimited by spaces. Any given wrapped
> line may have as many as 3 lines.
O.k.
So from this:
wrapped long line 1[NL]
still line 1[NL]
[NL]
another wrapped long line 2[NL]
and still line 2[NL]
[NL]
to:
wrapped long line 1 still line 1[NL]
another wrapped long line 2 and still line 2[NL]
... only one line needs to be changed in the macro:
Begin_Of_File
while(! At_EoF){ // check complete file
End_Of_Line
Line(1, ERRBREAK) // next line ...
if (Match("|L") != 0){ // ... is not an empty one (is a cont. line)
Del_Char(-Chars_Matched) // delete preceeding NewLine char(s)
Ins_Text(" ") // and (optionally) insert a space
}else{ // ... else is an end-of-record ...
Del_Line(1) // delete this empty line
}
}
-------------------
The same could be done by two "simple" Search+Replace, in a macro or
manually:
// Unwrap wrapped lines
Replace("([^\N])\N([^\N])", "\1 \2", REGEXP+BEGIN+ALL+NOERR)
//
// Remove remaining empty lines
Replace("|L|L", "|N", BEGIN+ALL+NOERR)
Christian