regex to remove comma between double quotes notepad++

前端 未结 4 2048
刺人心
刺人心 2020-12-05 05:50

I am trying to remove commas inside double quotes from a csv file in notepad++, this is what I have:

1070,17,2,GN3-670,\"COLLAR B, M STAY\",\"2,606.45\"
         


        
4条回答
  •  臣服心动
    2020-12-05 06:32

    mrki, this will do what you want (tested in N++):

    Search: ("[^",]+),([^"]+")

    Replace: $1$2 or \1\2

    How does this work? The first parentheses capture the beginning of the string up to (but not including) the comma into Group 1. The second parentheses capture the end of the string after the comma into Group 2. The replacement substitutes the string with a concatenation of Group 1 and Group 2.

    In more detail: in the first parentheses, we match the opening double quotes then any number of characters that are not a comma. That is the meaning of [^,]+. In the second parentheses, we match any number of characters that are not a double quote with [^"]+, then the closing double quotes .

提交回复
热议问题