0

Looking to get some insight as I'm lost on this one. I'd like to move lines based on the ending of previous one. It's a large CSV file that has a comment column that exported in line breaks from the original software. Sometimes there's only one line jump sometimes theres a few and sometimes none. The only saving grace in this output is that the line will always end with a number finishing by 0;

Source:

a;b;c;d;e;f;0;
a;b;c;d;e;f
f continued;0;
a;b;c;d;e;f;140;
a;b;c;d;e;f
f continued
and continued again;0;

What I'm looking to achieve

a;b;c;d;e;f;0;
a;b;c;d;e;f f continued;0;
a;b;c;d;e;f;140;
a;b;c;d;e;f f continued and continued again;0;

1 Answers1

0

In your sample file, just remove the carriage return in all lines that do not end with a semicolon.

In notepad++ you can use regex, search ([^;])$(\r|\n)+ and replace it with \1 , to obtain your goal.

Here you can see the regex in action https://regex101.com/r/4Mw4iW/1

aborruso
  • 347