Regex match all lines that don't end with ,0 and ,1

前端 未结 4 1723
刺人心
刺人心 2020-12-21 10:18

I have a malformed CSV file which has two columns: Text,Value

The value is either 1 or 0, but some lines are malformed and span two lines:

1. \"This          


        
4条回答
  •  心在旅途
    2020-12-21 10:31

    I don't know how the other answer would work:

    Something like the below is what I would use in Notepad++

    [^,][^01]$
    

    Here are the steps I did:

    Use ([^,][^01])$ to match the lines and replaced with \1{marked}

    Then switched to extended mode and replaced {marked}\r\n with `` ( empty ) to get a single line.

    Screenshots below:

    enter image description here

    enter image description here

提交回复
热议问题