IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 8, 2010, 3:42:56 PM (16 years ago)
Author:
watersc1
Message:

Fix parsing to correctly handle extra comments and blank lines. This ensures that the example text parses correctly (which you'd think I'd have checked before).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/detect_query_create

    r28806 r29129  
    307307    while (<$in>) {
    308308        chomp;
     309#       print STDERR "$line_num $#keywords $_\n";
     310        if ($_ =~ /^\s*$/) {
     311            next;
     312        }
    309313        if ($line_num == 0) {
     314            if ($_ !~ /EXTVER/) {
     315                next;
     316            }
    310317            # Parse header information keywords
    311318            $_ =~ s/#//g;
     
    319326            my @values = split /\s+/;
    320327            if ($#values != $#keywords) {
    321                 die "Number of header columns in input does not equal expected number of header words";
     328                die "Number of header columns in input does not equal expected number of header words $#values $#keywords";
    322329            }
    323330            for (my $i = 0; $i <= $#values; $i++) {
     
    326333        }
    327334        elsif ($line_num == 2) {
     335            if ($_ !~ /ROWNUM/) {
     336                next;
     337            }
    328338            # Parse table information keywords, dumping old keywords
    329339            $_ =~ s/#//g;
     
    338348                my @values = split /\s+/;
    339349                if ($#values != $#keywords) {
    340                     die "Number of header columns in input does not equal expected number of header words";
     350                    die "Number of header columns in input does not equal expected number of header words $#values $#keywords";
    341351                }
    342352                for (my $i = 0; $i <= $#values; $i++) {
Note: See TracChangeset for help on using the changeset viewer.