Importing csv file with line breaks to R or Python Pandas
<p>I have a csv file that includes line breaks within columns:</p>

<pre><code>"id","comment","x"
1,"ABC\"xyz",123
2,"xyz\"abc",543
3,"abc
xyz",483
</code></pre>

<p>ID 3, for example contains such a line break.</p>

<p>How can this be imported into python or R? Also, I don't mind if those line breaks were to be replaced by a space, for example.</p>

<p>the problem seemed to be not the line breaks, but rather the escaped upper quotes within the columns: <code>\"</code>.</p>

<p>Python: zvone's answer worked fine!</p>

<pre><code>import csv

with open(filename) as f:
    reader = csv.reader(f)
    csv_rows = list(reader)
</code></pre>

<p>R: <code>readr::read_csv</code> worked without having to change any of the defaults.</p>

python csv