title: Fastest way to find lines of a file based on column from another larger file in awk
body: <p>I have input file (1.csv), has about 0.5M lines and multiple files of CLEANUP_BC_[1-10].csv has about 10 millions. 1.csv has a single field f1 per line while CLEANUP_BC_[1-10].csv  has 2 fields, f1 through f2, delimited by ,.</p>
  <p>I want to find all lines from 1.csv where f1 of 1.scv matches f1 of CLEANUP_BC_[1-10].csv, if its matches write a output based on CLEANUP_BC_[1-10].csv file F2 column last digit.</p>
  <p>cat 1.csv</p>
  <pre><code>15192151898
  11000000012
  11000000019
  11000000077
  12042050006
  12042050053
  12042050158
  12042050161
  12042050178
  12042050198
  </code></pre>
  <p>CLEANUP_BC_1.csv</p>
  <pre><code> 15192151898, 732539481
   16133029583, 707751921
   16133636489, 540841871
   16476205207, 770565711
   16132823434, 459659751
   12363335422, 889809091
   14372484755, 739320471
   12368188419, 732539481
   12042050161, 770565711
   17807200578, 744517871
  </code></pre>
  <p>CLEANUP_BC_2.csv</p>
  <pre><code> 12042050198, 592494702
   16134492706, 739754232
   12363321831, 747588192
   19053343880, 432742682
   12262185649, 779803212
   16047157202, 888743762
   19054607842, 789457272
   12505168454, 138011622
   14372156219, 781262852
   12042050158, 765193222
  </code></pre>
  <p>Script:</p>
  <pre><code>awk 'FNR==NR{
   hash[$1]; next
   }
   {
      for (i in hash) if (match($0,i)) {print; break}
   }' 1.csv FS=',' CLEANUP_BC_*
  </code></pre>
  <p>Expected Output:</p>
  <p>cat 1.csv</p>
  <pre><code> 15192151898, 732539481
   12042050161, 770565711
  </code></pre>
  <p>cat 2.csv</p>
  <pre><code> 12042050198, 592494702
   12042050158, 765193222
  </code></pre>