(Python) Program to read specific data from many output files
<p>I recently ran a simulation that output temporal data in directories numbered <code>0</code>, <code>0.1</code>, <code>0.2</code>, ... , <code>10</code>. </p>

<p>Within each of these directories there is a text file called <code>rigidMotion</code> which contains a line I want to read.</p>

<p>The line looks like:</p>

<pre><code>centreOfRotation (0.000 0.000 0.000) //
</code></pre>

<p>where the numbers vary of course.</p>

<p>I would then like only the numbers to be sent to a text file or a csv file so I can plot them.</p>

<p>Given that its the same line in each file I was trying to use linecache but I'm not sure how to set up the for loop to read each directory.</p>