Python: How to read csv file with different separators?
<p>This is the first line of my txt.file</p>

<pre><code>0.112296E+02-.121994E-010.158164E-030.158164E-030.000000E+000.340000E+030.328301E-010.000000E+00
</code></pre>

<p>There should be 8 columns, sometimes separated with '-', sometimes with '.'. It's very confusing, I just have to work with the file, I didn't generate it.</p>

<p>And second question: How can I work with the different columns? There is no header, so maybe:</p>

<p><code>df.iloc[:,0]</code> .. ? </p>

<p>A possible solution is the following:</p>

<pre><code>row = '0.112296E+02-.121994E-010.158164E-030.158164E-030.000000E+000.340000E+030.328301E-010.000000E+00'
chunckLen = 12
for i in range(0, len(row), chunckLen):
    print(row[0+i:chunckLen+i])
</code></pre>

<p>You can easly extend the code to handle more general cases.</p>

python csv pandas