title: HTML::TableExtract: how to run the right argument [see live example]
body: <p>A question regarding a parser. Is there any chance to catch some separators within the that separate the table...  The paser script runs allready nicely. Note - i want to store the data into a MySQL database. So it would be great to have some seperators - (commas, tabs or somewhat else - a tab seperated values or comma seperated values 
  are handy formats to work with... </p>
  
  <p>(  here the data out of the following site:  <a href="http://192.68.214.70/km/asps/schulsuche.asp?q=a&amp;a=20" rel="nofollow">http://192.68.214.70/km/asps/schulsuche.asp?q=a&amp;a=20</a>  )</p>
  
  <blockquote>
    <p>lfd. Nr. Schul- nummer Schulname
    Straße PLZ Ort Telefon Fax Schulart
    Webseite 1 0401 Mädchenrealschule
    Marienburg, Abenberg, der Diözese
    Eichstätt Marienburg 1 91183 
    Abenberg   09178/509210  Realschulen 
    mrs-marienburg.homepage.t-online.de  2
    6581 Volksschule
    Abenberg (Grundschule) Güssübelstr. 2
    91183  Abenberg   09178/215
    09178/905060 Volksschulen 
    home.t-online.de/home/vs-abenberg  6
    3074 Private Berufsschule zur
    sonderpäd. Förderung,
    Förderschwerpunkt Lernen, Abensberg
    Regensburger Straße 60 93326 
    Abensberg  09443/709191 09443/709193
    Berufsschulen zur sonderpädog.
    Förderung
    www.berufsschule-abensberg.de</p>
  </blockquote>
  
  <p>Well i need to have those lines divided into at least three columns - take the first record.</p>
  
  <blockquote>
    <p>name: Volksschule
    Abenberg (Grundschule) street:
    Güssübelstr. 2 postal-code and town:
    91183  Abenberg fax and telephone:
    09178/215 09178/905060  type of
    school: Volksschulen website:
    home.t-online.de/home/vs-abenberg</p>
  </blockquote>
  
  <p>Or <strong>even better</strong> - i have divided the postal-code and town into two seperate columns!? 
  Question: is this possible?</p>
  
  <p>By the way: see the first record: (here i only show the names of the school) </p>
  
  <blockquote>
    <p>1 0401 Mädchenrealschule
    Marienburg, Abenberg,  6 3074 Private
    Berufsschule zur sonderpäd. Förderung,
    Förderschwerpunkt Lernen, Abensberg</p>
  </blockquote>
  
  <p>Those have some commas inside the name; does this make it difficult to create a parser that creates csv-fomate? </p>
  
  <p>any idea how to do this in Perl... If possible it would be just great!! 
  many many thx for a hint regarding this little issue - besides this all is great and fascinating! </p>
  
  <p>zero</p>
  
  <p>BTW - if you want - i can add the code. No problem here.</p>
  
  <pre><code>  #!/usr/bin/perl
      use strict;
      use warnings;
      use HTML::TableExtract;
      use LWP::Simple;
      use Cwd;
      use POSIX qw(strftime);
      my $te = HTML::TableExtract-&gt;new;
      my $total_records = 0;
      my $suchbegriffe = "e";
      my $treffer = 50;
      my $range = 0;
      my $url_to_process = "http://192.68.214.70/km/asps/schulsuche.asp?q=";
      my $processdir = "processing";
      my $counter = 50;
      my $displaydate = "";
      my $percent = 0;
  
      &amp;workDir();
      chdir $processdir;
      &amp;processURL();
      print "\nPress &lt;enter&gt; to continue\n";
      &lt;&gt;;
      $displaydate = strftime('%Y%m%d%H%M%S', localtime);
      open OUTFILE, "&gt;webdata_for_$suchbegriffe\_$displaydate.txt";
      &amp;processData();
      close OUTFILE;
      print "Finished processing $total_records records...\n";
      print "Processed data saved to $ENV{HOME}/$processdir/webdata_for_$suchbegriffe\_$displaydate.txt\n";
      unlink 'processing.html';
      die "\n";
  
      sub processURL() {
      print "\nProcessing $url_to_process$suchbegriffe&amp;a=$treffer&amp;s=$range\n";
      getstore("$url_to_process$suchbegriffe&amp;a=$treffer&amp;s=$range", 'tempfile.html') or die 'Unable to get page';
  
         while( &lt;tempfile.html&gt; ) {
            open( FH, "$_" ) or die;
            while( &lt;FH&gt; ) {
               if( $_ =~ /^.*?(Treffer &lt;b&gt;)(d+)( - )(d+)(&lt;/b&gt; w+ w+ &lt;b&gt;)(d+).*/ ) {
                  $total_records = $6;
                  print "Total records to process is $total_records\n";
                  }
               }
               close FH;
         }
         unlink 'tempfile.html';
      }
  
      sub processData() {
         while ( $range &lt;= $total_records) {
            getstore("$url_to_process$suchbegriffe&amp;a=$treffer&amp;s=$range", 'processing.html') or die 'Unable to get page';
            $te-&gt;parse_file('processing.html');
            my ($table) = $te-&gt;tables;
            for my $row ( $table-&gt;rows ) {
               cleanup(@$row);
               print OUTFILE "@$row\n";
            }
            $| = 1; 
            print "Processed records $range to $counter";
            print "\r";
            $counter = $counter + 50;
            $range = $range + 50;
            $te = HTML::TableExtract-&gt;new;
         }
      }
  
      sub cleanup() {
         for ( @_ ) {
            s/s+/ /g;
         }
      }
  
      sub workDir() {
      # Use home directory to process data
      chdir or die "$!";
      if ( ! -d $processdir ) {
         mkdir ("$ENV{HOME}/$processdir", 0755) or die "Cannot make directory $processdir: $!";
         }
      }  
  </code></pre>