title: Process Hundreds of Input Files Using AWK
body: <p>I have 3 folders containing files as follow:</p>
  
  <ol>
  <li>Folder1 contains only 1 file called "data".</li>
  <li>Folder2 contains more than a hundred files that their names start with "part1" with the same text structure.</li>
  <li>Folder3 contains more than a hundred files that their names start with "part2" with the same text structure.</li>
  </ol>
  
  <p>I've created a program using AWK that takes as input the file from folder1, <strong>only 1 file</strong> from folder2 and <strong>only 1 file</strong> from folder3, and it works well.</p>
  
  <p>Now i want to give the program all the files from all the folders as input, therefore, <strong>i need a test method</strong> to know that the program has finished from the first 2 files (part1* + part2*) and will start to process the next ones, in order to reset all the variables and arrays for the new processing.</p>
  
  <p>The program will be run like this:</p>
  
  <pre><code>$ awkprogram folder1/data folder2/part1* folder3/part2*
  </code></pre>