notepad++line-breakscarriage-returnquotation-marks

Remove Wrap Text Quotation Mark


I have a csv file which I am attempting to edit and I notice that there is a line break with text encased in quotation marks. The break causes a portion of text to appear on a new line. See Current State (below)

I am attempting to remove the break and quotation marks so that the text that is broken can appear in one line. See EndState for what is wanted.

I am new to Notepad++ and not sure if there is a RegEx expression to complete this or a line operation that might help. Any insight would be appreciated.

Current State

123|12345678910|Harry|Potter?PotterHead|07/31/1980|Test|Test|Project-Test-20240206|Project-Test-20240206|"Return all Information
All information must be returned"|01/01/2024|01/02/2024

EndState

123|12345678910|Harry|Potter?PotterHead|07/31/1980|Test|Test|Project-Test-20240206|Project-Test-20240206|Return all Information All information must be returned|01/01/2024|01/02/2024

Solution

  • Replacing \|"([^"\r\n]*)\R([^"\r\n]*)"\| with |\1 \2| should work.

    Explanation

    \|           Vertical bar, need escaping
    "            Itself
    (            Capture group 1, containing:
    [^"\r\n]*       Zero or more characters that are not quotes or CR or LF
    )            End capture group
    \R           Any sort of newline
    ([^"\r\n]*)  Another capture group, number 2
    "\|          Quotes and vertical bar
    

    The replacement string inserts the vertical bars and the two capture groups, it omits the two double-quotes. There is a space in the replacement to replace the newline sequence.