title: Read and parse multiple text files
body: <p>Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files
  In the below files, we are interested in </p>
  
  <p>File 1: </p>
  
  <pre><code>38  107 C   3   T   6   C/T
  38  241 C   4   T   5   C/T
  38  247 T   4   C   5   T/C
  38  259 T   3   C   6   T/C
  38  275 G   3   A   5   G/A
  38  304 C   4   T   5   C/T
  38  323 T   3   A   5   T/A
  </code></pre>
  
  <p>File2:</p>
  
  <pre><code>38  107 C   8   T   8   C/T
  38  222 -   6   A   7   -/A
  38  241 C   7   T   10  C/T
  38  247 T   7   C   10  T/C
  38  259 T   7   C   10  T/C
  38  275 G   6   A   11  G/A
  38  304 C   5   T   12  C/T
  38  323 T   4   A   12  T/A
  38  343 G   13  A   5   G/A
  </code></pre>
  
  <p>Index file :</p>
  
  <pre><code>107
  222
  241
  247
  259
  275
  304
  323
  343
  </code></pre>
  
  <p>The index file is created based on unique positions from file 1 and file 2. I have that ready as index file. Now i need to read all files and parse data according to the positions here and write in columns. 
  From above files, we are interested in 4th (Ref) and 6th (Alt) columns. 
  Another challenge is to name the headers accordingly. So the output should be something like this.</p>
  
  <pre><code>Position    File1_Ref   File1_Alt   File2_Ref   File2_Alt
  107 3   6   8   8
  222         6   7
  241 4   5   7   10
  247 4   5   7   10
  259 3   6   7   10
  275 3   5   6   11
  304 4   5   5   12
  323 3   5   4   12
  343         13  5
  </code></pre>