I have a file that I am busy trying to correct that has some dodgy Line Breaks inside of it, this is a small example
Row ('Row 01') Property ('Property 01')
Row ('Row 02') Property ('Property
02')
Row ('Row 03') Property ('Property 03')
So the second line has a Line Break in the value for Property which should just be one line like the first and last line.
I can correct it by doing the following in VIM
Remove all Line Breaks everywhere
:%s/\n/ /g
Which gives me
Row ('Row 01') Property ('Property 01') Row ('Row 02') Property ('Property 02') Row ('Row 03') Property ('Property 03')
Then
Reinsert new Line Breaks only where they are wanted
:%s/ Row/\rRow/g
Which gives the data that I want
Row ('Row 01') Property ('Property 01')
Row ('Row 02') Property ('Property 02')
Row ('Row 03') Property ('Property 03')
The problem is that removing every single Line Break cannot happen on a file with thousands of lines because it is terribly slow.
I'm wondering if there isn't a better VIM search and replace way of handling this without collapsing everything into a single line initially