Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        my @fields = split /%/;
        print join(", ", @fields), "\n";
    }
    
  2. or download this
    $ perl 1103507.pl
    *----------*--------*        ,    Trm 4              Trm7            ,
    +  Trm 5
    ...
    
    ,     0.00Y ,    -0.3 ,     0.0 ,     6.5 ,
    
  3. or download this
    s/^\s+// for @fields; # remove leading blanks
    s/\s+$// for @fields; # remove trailing blanks
    
  4. or download this
    $ perl 1103507.pl
    *----------*--------*, Trm 4Trm7, Trm 5Trm, Trm9, TrmY0,
    ...
    , 0.00X, -0.X, 0.0, 6.5,
    , -0.07Y, -0.5, 0.0, 6.5,
    , 0.00Y, -0.3, 0.0, 6.5,
    
  5. or download this
    my @fields = split /\s*%\s*/;
    
  6. or download this
    next if $fields[$i] =~ /----/;
    
  7. or download this
    $ perl 1103507.pl
    , Trm 4Trm7, Trm 5Trm, Trm9, TrmY0
    ...
    , 0.00X, -0.X, 0.0, 6.5
    , -0.07Y, -0.5, 0.0, 6.5
    , 0.00Y, -0.3, 0.0, 6.5
    
  8. or download this
    print join(", ", map {qq("$_")} @headings), "\n";
    
  9. or download this
    # Extract the data
    while (<DATA>) {
    ...
        }
        print join(", ", @fields), "\n";
    }
    
  10. or download this
    "", "Trm 4Trm7", "Trm 5Trm", "Trm9", "TrmY0"
    , 0.021, "-0.X", 0.0, "5.X"
    ...
    , "0.00X", "-0.X", 0.0, 6.5
    , "-0.07Y", -0.5, 0.0, 6.5
    , "0.00Y", -0.3, 0.0, 6.5
    
  11. or download this
    shift @fields;
    
  12. or download this
     . . . snip . . .
    shift @headings;
    ...
        print join(", ", @fields), "\n";
    }
     . . . snip . . .
    
  13. or download this
    # table_2_csv.pl <FName>
    #
    ...
    TEXT MATCHING header here!
    
     . . . snip: no reason to repeat the data . . .
    
  14. or download this
    *------%------%-------------%
    %      %      % Col3 % Col4 %
    % Col1 % Col2 *------*------*
    %      %      % Bar  % Baz  %
    %======*======*======*======*