Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I took a different approach, probably less elegant and certainly less flexible than others. But it does seems to work. As the choice of some variable names might indicate ( %HoA $aref ), I am relatively new to perlish ways and am just getting familiar with usage of the various data structures.

use strict; use warnings; my %HoA; while ( <DATA> ) { next if m/^\D/; # ignore lines not beginning with a digit my ( $SampleID, $Time, $A_ObsConc, $C_ObsConc, $F_ObsConc ) = unpack("A9 A8 A15 A9 A*", $_); push @{ $HoA{A} } , [ $SampleID, $Time, $A_ObsConc ]; push @{ $HoA{C} } , [ $SampleID, $Time, $C_ObsConc ]; push @{ $HoA{F} } , [ $SampleID, $Time, $F_ObsConc ]; } for my $key ( sort keys %HoA ) { for my $aref ( @{ $HoA{$key} } ) { printf("%s %6s %9s %9s\n", $key, @$aref ); } } __DATA__ A C F SampleID Time ObsConc ObsConc ObsConc 5 24 2.27E+06 687.02 32521.94 5 168 1.92E+06 525.02 22198.44 5 12 2.94E+06 896.39 41331.61 5 -0.5 2.23E+06 942.34 40616.49 5 8 4.03E+06 1371.32 45863.69 6 24 1.02E+06 1057.89 46341.04 6 168 3.14E+06 4987.32 42166.08

In reply to Re: format conversion, please help by farang
in thread format conversion, please help by david_lyon

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [Discipulus]: but is really necessary to support these ancient versions? from 5.14 onward is not enough?
    [Discipulus]: yes marto I understood
    [Corion]: Discipulus: I'm slowly migrating my code to require 5.8.x ;) Most of my code works on 5.6, but Filter::signatures requires 5.10 I think
    [Corion]: 5.14 is also a good target, widely available and fairly stable. Also, over five years old, which doesn't push people into a needless upgrade cycle
    [Discipulus]: yes I saw your efforts Corion but the pain is worth?
    [Corion]: Discipulus: IMO it's not that much pain, but most of the systems I use have a Perl 5.14 or newer on them nowadays
    [marto]: the question is more, is Padre still the way new users should be directed?
    [Discipulus]: ah ah I have all 5.26 atm but I play alone..
    [Corion]: Except this RHEL box, which comes with Perl 5.10.1 , but there I installed my own 5.20.3 for the real Perl programs we run ;)
    [Corion]: marto: I used Padre for some time but then switched to Notepad++, since all the funky features I wanted to put into Padre couldn't be made to work, and/or I lost interest :)

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (10)
    As of 2018-06-25 08:49 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (126 votes). Check out past polls.