IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 30, 2014, 11:43:09 AM (12 years ago)
Author:
heather
Message:

working detectionbatch, needs lot of work on stack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/config/parse_vot.pl

    r36697 r36706  
    33# this thing will just parse the votables and print out in 'ken schema style'
    44
    5 $wiki=1;
    6 
     5#$wiki=1;
     6$csv = 1;
    77$infield = 0;
    88$intable = 0;
     
    3333        if($datatype eq "long") {$datatype1 = "BIGINT 8";}
    3434
    35        
     35        if ($csv) {
     36            $datatype1 =~ s/ .//;
     37
     38        }
    3639
    3740        if ($_ =~ /.*default=\"/) {
     
    4952        if ($wiki) {
    5053        printf("||%-17s||   %-15s||   %-15s ||   %-5s||",$name, $unit, $datatype1, $default);
    51         } else {
    52         printf("%-17s   %-15s   %-15s    %-5s",$name, $unit, $datatype1, $default);
     54        } elsif ($csv) {
     55            printf("%s,%s,%s,%s,\"",$name, $unit, $datatype1, $default);
    5356        }
    54 
     57       
    5558
    5659        $infield = 1;
     
    6871            if ($_ =~ /\<\/FIELD/) {
    6972                if ($wiki) { print "||";}
     73                if ($csv) {print "\"";}
    7074                print "\n";
    7175                $infield = 0;
    7276            }
    73 
     77           
    7478        } else {
    7579            #not in field something new
     
    8084                $name =~ s/\".*//g;
    8185                $intable = 1;
    82                 print "---------------------------\n";
    83                 printf ("%-16s   ", $name);
     86                if ($csv) {
     87                    print "$name\n";
     88                } else {
     89                    print "---------------------------\n";
     90                    printf ("%-16s   ", $name);
     91                }
    8492            } else {
    8593                if ($intable) {
    86                             if ($_ =~ /\<\/DESCRIPTION/) {
    87                 $t = $_;
    88                 chomp $t;
    89                 $t =~ s/\s+\<DESCRIPTION\>//;
    90                 $t =~ s/\<\/DESCRIPTION\>//;
    91                 print "$t\n";
    92                 print "---------------------------\n";
    93                 $intable = 1;
     94                    if ($_ =~ /\<\/DESCRIPTION/) {
     95                        $t = $_;
     96                        chomp $t;
     97                        $t =~ s/\s+\<DESCRIPTION\>//;
     98                        $t =~ s/\<\/DESCRIPTION\>//;
     99                        if ($csv) {
     100                            $dostuff = 1;
     101                        } else {
     102                            print "$t\n";
     103                            print "---------------------------\n";
     104                        }
     105                        $intable = 1;
     106                       
     107                    }
     108                   
     109                }
     110            }
     111            if ($_ =~ /\<\/TABLE\>/) {
     112                $intable = 0;
    94113            }
    95114
    96                 }
    97                 if ($_ =~ /\<\/TABLE\>/) {
    98                     $intable = 0;
    99                 }
    100             }
    101 
     115           
    102116        }
    103117    }
Note: See TracChangeset for help on using the changeset viewer.