title: python read -> analyze -> print multiple files
body: <p>I have 6 files of similar format but different name. 
  (for example, file_AA.dat file_AB.dat file_AC.dat file_BA.dat file_BB.dat file_BC.dat) </p>
  
  <p>Can I write a for-loop script to read, analyze, and print out those files at once, instead of operating script 6 times? Such as, </p>
  
  <pre><code>for i in {AA AB AC BA BB BC} 
   filename = 'file_$i.dat'
   file = open (filename, 'r')
   Do a lot, lot of analysis for lots of rows and columns :P 
   file open('output_file_$i.dat','w')
   Do some for loop for writing and calculation 
  file.close
  </code></pre>
  
  <p>So, I hope to automate the process of reading / analyzing / writing the different files (but similar format) at once. I'm curious about how could I handle its naming of input/output part. This way, I wish I could analyze numerous number of files more quickly and easily. </p>
  
  <p>Or, is there any way to do the same using the mix of python and Cshell or shell script?  </p>
  
  <p>Thank you </p>