![sublime merge multiple lines to single line sublime merge multiple lines to single line](https://generalassemb.ly/blog/wp-content/uploads/2013/11/sublime-groups.png)
You should get,as expected, the replaced text, below : bördelversuch flanging test, folding testįührungszapfen guide pilot, guide pin, pilot pin Select the Regular expression search modeĬlick THREE times, on the Replace All button, till the message Replace All: 0 occurrences were replaced is displayed, in blue, at the bottom of the Replace dialog In the Replace with zone, type the regex \1, \3, with a SPACE character, after the comma symbol Move back the caret before the first line We, finally, get the text, to work on : bördelversuch flanging test The part line number #:, that begins each line, for information, must be deleted
#Sublime merge multiple lines to single line code#
The string TAB, with a space character before and after, refers to a single tabulation character \t, of code \x09 Glossar, from your original text, below : Hum… Very strange ! As for me, it works quite fine ! So, Vasile, let’s recapitulate : Hope that this S/R may helps you, Glossar ! It’s not very difficult to understand that, as we, always, rewrite, first, all the contents of a line, followed by the second part of the next line, this process is cumulative on any amount of lines, whose part, before the tabulation character, are identical ! The group 3, which represents the part of text, after the tabulation character, in the second line
![sublime merge multiple lines to single line sublime merge multiple lines to single line](https://www.mediasuite.co.nz/blog/wp-content/uploads/2018/03/sublime-text.jpg)
That is to say, all the contents of the first line, without its line-break, followed by : The group 1, whose contents are (.+\t).+. + ), without line-break, stored as the group 3 +\t ), that is to say, the SAME range of text, between beginning of line and the tabulation included, than in the previous line, and, finally, followed by :Īny other non-null range of characters (. + ), followed by :Īny kind of EOL characters ( \R ), followed by : + ), followed by :Ī tabulation character ( \t ), followed by :Īny other non-null range of characters (. Then, the regex engine looks, from beginning of line ( ^ ) for :Īny non-null range of characters (. So, it should stay stuck to the very beginning of your file !Īs usual, the in-line modifier (?-s) ensures you that the dot meta-character will match standard characters, only, even if you previously checked the. This means that if, in your file, the maximum of consecutive lines with identical contents till the tabulation character, are N, you’ll have to hit N times, on the Replace All button, to get all the work done !ĭon’t forget that the caret does NOT move during the Replace All operation. Select, of course, the Regular expression search modeĬlick on the Replace All button, SEVERAL times, till the message Replace All: 0 occurrences were replaced is displayed, in blue, at the bottom of the Replace dialog Uncheck, preferably, the Wrap around option In the Replace with zone, type the regex \1, \3, with a space character, after the comma symbol Move back to the very beginning of your file ( Ctrl + Origin ) Once again, regexes can do miracles :-)) Just follow these few steps, below : Maybe you could extend and generalize your formula accordingly?
![sublime merge multiple lines to single line sublime merge multiple lines to single line](https://forum.sublimetext.com/uploads/default/original/3X/6/b/6b98d797a66d2f3dab2fbef8bf5da54bf7ad1b47.gif)
Line 659368: horizontal geteilt TAB horizontally divided, horizontally split
![sublime merge multiple lines to single line sublime merge multiple lines to single line](https://forum.sublimetext.com/uploads/default/original/3X/7/9/7974476ff2a075b51be832bbbbdc9bfa98fbb5dd.png)
Line 28872: führungszapfen TAB guide pilot, guide pin, pilot pin Line 344: bördelversuch TAB flanging test, folding test Line 659369: horizontal geteilt TAB horizontally split Line 659368: horizontal geteilt TAB horizontally divided Line 28872: führungszapfen TAB guide pilot Line 344: bördelversuch TAB flanging test “If the text up to the tab (\t) in a line is the same as the text(s) up to the tab(s) in the consecutive line(s), keep one occurrence of them and merge everything on the right hand sides of the tabs in the consecutive lines in question.”Īnother example (and by “TAB” I mean “\t”): At first I thought the “table” in your formula is a kind of function word, but it is not.īasically I need a regex expression or a Notepad++ function or a combination of both that will perform the following expression: (I hope I can express: ) )