How to get a list of file names in a directory in Python
<p><strong>Problem:</strong></p>

<p>In my "D:/collection" folder, I have two types of files, that are "8-digit-number_type.dbf" and "character_type.dbf" as follows: 00093282.dbf, 00345602.dbf, 69209340.dbf, 69806980.dbf, 92406482.dbf, 93609360.dbf,..., aaa.dbf, bbb.dbf,.... </p>

<p><strong>Objective:</strong></p>

<p>I want to take only the "8-digit-number_type.dbf" files, and exclude the "character_type.dbf" files from my analysis. I don't care about the "character_type.dbf" files. Then, I'd like to split the 8 digits into two 4-digit values. So, a listing file(say,list.txt) with two columns should look like the following:</p>

<pre><code>0009 3282
0034 5602
6920 9340
6980 6980
9240 6482
9360 9360
....
</code></pre>

<p>And these values should be stored as character type.</p>

<p>How can I implement that in Python? Thank you.</p>

<p>Sincerely,
Bill TP</p>
