Page 1 of 1
merge lines based on conditions
Posted: Wed Feb 08, 2012 6:43 am
by dave maheshwari
11297 line *&(*&_)(_)()_(_( line ends
line ba bla bla
line ba bla bla
11276 line *&(*&_)(_)()_(_( line ends
98764 line *&(*&_)(_)()_(_( line ends
line again some ba bla bla
I would like to merge all the lines to a single line that does not begin with the 5 numbers
11297 line *&(*&_)(_)()_(_( line ends line ba bla bla line ba bla bla
11276 line *&(*&_)(_)()_(_( line ends
98764 line *&(*&_)(_)()_(_( line ends line again some ba bla bla
I am able to get the first 5 number [0-9][0-9][0-9][0-9][0-9] but not sure how to merge lines when that does not appear ..
any help would be great -- Thanks in advance
Posted: Wed Feb 08, 2012 8:29 am
by ben_josephs
In TextPad this sort of thing can only be done with clunky methods, like this:
Use "Posix" regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Search | Replace... (
<F8>):
Find what: \n([^0-9]....|.[^0-9]...|..[^0-9]..|...[^0-9].|....[^0-9])
Replace with: _\1 [Replace the underscore with a space]
[X] Regular expression
Replace All
This would be much simpler using a regex with negative look-ahead. But TextPad's regex recogniser doesn't support look-ahead. (WildEdit's recogniser (
http://www.textpad.com/products/wildedit/), on the other hand, does.)
Posted: Wed Feb 08, 2012 8:38 am
by dave maheshwari
Awesome ....works like a charm ... thanks a bunch