Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
I have a large error file that reports 3 lines per 'error' listing that I am trying to merge all 3 lines into 1 line.
When I highlight the 3 lines in Notepad++ then do join line (ctl-j) works great BUT working through 12000 lines manually doesn't seem effective.
I create a Macro by recording my steps & it works BUT I still need to highlight the rows & then run the macro.
Is there a way to create a macro that highlights the rows as the first step of the macro then run the line join command? Seems like there should be but I'm not seeing how to record/create that step.
Any help is appreciated.
I think that your problem can be solved by the use of regular expressions :-)
But, of course, I need a few examples of these error blocks, in order to find out the under-structure of these 3 lines.
When this first step done, it shouldn't be very difficult to join each block of 3 lines into a single line !
How about this:
hope this helps
Hi Gina, GerdB and All,
The GerdB's solution is nice too, because you can affect a shortcut to this macro.
But, if your log file contains ONLY a list of errors, with 3 lines per error, without any other text, you can use the general regex below :
SEARCH : (.+)\R(.+)\R(.+)
REPLACE : \1 \2 \3 with a space after digits 1 and 2
\1 \2 \3
Place the cursor at the beginning of the first group of 3 lines.
Fill in the two zones, Find what and Replace with, with the two regexes above.
Click on the Regular expression radio button.
Uncheck, if necessary, the . matches newline square button.
Click on the Replace All button.
Et voila !
In the general case where the text, to group in n lines, may contain empty lines, use the S/R below :
SEARCH : (.*)\R(.*)\R(.*)\R......(.*)\R
REPLACE : \1 \2 \3 .......\n\r\n
\1 \2 \3 .......\n\r\n
As I added \R at the end of this SEARCH regex, the last part will match, at least, the EOL character(s) of the last line of each n-lines set