Regex: Put all sentences from Tabs on a single Line


#1

hello. I have 2 columns or maybe two sentences separated by tabs. Every sentence is separated by tab and divided under one another.

To understand much better my problem, please take a look at the print screen.

So, I want to put those 2 sentence in one single line, after the other, without being separated by tabs or space.

I try this regex, but it is not very good, because mix them in instead to put side by side.

Search:
\s+(.*?)
Replace by:
leave a space

Can anyone help me with another solution?


#2

If the problem is always a fixed number of lines, then regular expressions could theoretically be used for this purpose. If it is a variable number of lines or varying numbers of sentences, I suspect you’re going to need to write some code. I don’t think regular expressions will work for the more complex scenarios.


#3

I’d investigate using a block selection plugin to cut/paste the second column into a different file (or even below the first one). Then the various search/replace operations to remove format would be easier.