On 11/4/2005 12:53:30 AM, Paul Breen wrote:
>I have a file which has more newlines than it should
>have. If a line begins with a number, it is OK. If the
>line begins with a character, I want to concatenate
>that line with the line preceeding it, until all lines
>in the file begin with a number.
Ian's example seems to delete too much characters (as far as I understood the task).
I would suggest:
BeginOfFile
// special handling if first line begins without a number
// (has to be defined, now: do nothing)
//
if (Match("|D") != 0) {
Line(1, NOERR)
}
repeat(ALL)
{
Search("|<|!|D",ERRBREAK) // search line beginning without a number
Del_Char(-Newline_Chars) // concatenate by deleting previous line's CR/LF
Ins_Text(" ") // insert a space as delimiter, if wished
}
Christian