![]() I'm quite sure that QuOtE does not exist in the CSV file.Įach double quote before and after the pipe character is also replaced by QuOtE by the next 2 non regular expression replaces.Įscaped double quotes "" in the CSV file are replaced next by QuOtEQuOtE with a non regular expression replace. Each double quote at beginning or end of a line is replaced by the string QuOtE by this replace. The first replace is a Perl regular expression replace. I have recorded several replaces into an UltraEdit macro InsertMode But double quotes, separators and line breaks included in a double quoted value are a nightmare for a regular expression find and replace in a CSV file. This very simple escaping algorithm makes reading in a CSV file character by character coded in a programming language very easy. This is explained for example in Wikipedia article about comma-separated values. But each double quote must be escaped with one more double quote. In general it is possible to have double quotes within a field value. Nanny posted a good solution, but for a Perl script, not for usage in a text editor like UltraEdit.
0 Comments
Leave a Reply. |