Parse and clean large log files
Perhaps switching the outputfile for each line can be avoided by sorting the inputfiles first or with some changes in your script:
# Store the 2-letter filenames
outfile[Fpath];
# Store the highest index for given outputfile
i[Fpath]++;
# Store current line in output array for that file
a[Fpath][i[Fpath]]=$0
# And in the END block print for array per output file
      for (out in outfile) {
         for (j=1;j&lt;=i[out]; j++) {
            print a[out][j] &gt;&gt; out;
         }
      }

This results in
awk '
    BEGIN {
        FS=&quot;:&quot;
    }
    {
        gsub(/^[ \t&quot;'\'']+|[ \t&quot;'\'']+$/, &quot;&quot;)
        $0=gensub(&quot;[,|;: \t]+&quot;,&quot;:&quot;,1,$0)
        if (NF&gt;1 &amp;&amp; $1 ~ /^[[:alnum:]_.+-]+@[[:alnum:]_.-]+\.[[:alnum:]]+$/ &amp;&amp; $0 ~ /^[\x00-\x7F]*$/)
        {
            Fpath=tolower(substr($1,1,2))
            Fpath=gensub(&quot;[^[:alnum:]]&quot;,&quot;_&quot;,&quot;g&quot;,Fpath);
            outfile[Fpath];
            i[Fpath]++;
            a[Fpath][i[Fpath]]=$0
        }
        else
            print $0 &gt;&gt; &quot;errorfile&quot;
    }
   END {
      for (out in outfile) {
         for (j=1;j&lt;=i[out]; j++) {
            print a[out][j] &gt;&gt; out;
         }
      }
   } ' &quot;$FILE&quot;