I have a file with about 1000 lines. All lines begin with a seven-digit number except for the occasional line. I need to catch these lines and actually join them with the previous line.
I've managed to be able to match any line that begins with a seven-digit number by using the following regex pattern:
^\d\{7}
I can't seem to get it to match any line that does not match this pattern though, which is really what I'm after.
As a second question that I'll embed into this one. Is it possible to have any lines that match (or do not match to stay consistent with what I'm trying to do) to join themselves to the previous line (as opposed to the J command that brings the next line up to the current one)?
Thanks