c# - .NET Regex To Remove Line Breaks Within Quotes -


I am trying to clear a text file so that it can be imported into Excel, but in many text files Inner line breaks. File of double quoted fields has been delimited.

The example would be:

  "12313" \ t "1234" \ t "123 5679" "test" \ t "test" \ t "test" "test" I need to remove line breaks like this: < / P> 
  "12313" \ t "1234" \ t "1235679" \ t "test" \ t "test" "test" \ t "test" \ t "test" "12313 "\ t" 1234 "\ t" 1235679 "  

" \ t "is the tab delimiter.

I saw many other solutions on SO, but they do not seem to deal with many lines. We have tried to use several CSV parser solutions but for this scenario they do not seem to work. The goal may be to give the full string in a regedx expression and return it between quotation marks with all line breaks, whereas the line two outside the quotation marks Will be lost.

You can use this regex:

  (? ! (([^ "] *") {2}) * [^ "] * $) \ N +   

This one or more new ones Corresponds to letters, which are no exception to not avoiding data based on the number of quotation marks).

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -