Remove mysterious line breaks in CSV file using Perl
<p>I have a CSV file that I'm parsing using Perl. The file is a BOM produced by Solidworks 2015 that was saved as an XLS file, then opened in Excel and saved as a CSV file.</p>

<p>There are cells that have line breaks. When I read a line with such a cell from the file, the line comes in with the line breaks. For example, here is one of the lines read looks like this:</p>

<pre><code>74,,74,1,1,"SJ-TL303202-DET-074-
001",PDSI,"2.25"" DIA. X  8.00""",A2,513,1,
</code></pre>

<p>It reads in as a single line in Perl.</p>

<p>When I turn the Show All Characters in Notepad++, I can see the line breaks are cause by [CR][LF].</p>

<p>So I thought this would work to remove the line feeds:</p>

<pre><code>$line =~ s/[\r\n]+//g;
</code></pre>

<p>but it does not.</p>