I have written a python program that creates multiple csv files from a json file. As delimiter, I want to use the pipe char. If the pipe char itself appears inside the data, I want this to be escaped with "!".
foo= csv.writer(open("myfile.csv", "w", newline='', encoding='utf-8'), quoting = csv.QUOTE_NONE, doublequote = False, quotechar='', delimiter="|", escapechar="!", dialect='unix')
This is working as expected, but if there is the escape char ("!") itself inside the data, this gets now escaped too (so there are two consecutive exclamation marks), which seems logical to me.
Unfortunately, the program, that processes the csv file afterwards (Teradata Parallel Transporter) only interprets the escape char as escape char, if it is directly followed by the delimiter char. Otherwise the data is considered to be "ordinary".
Is there an easy way to not escape the escape char in the csv writer?