I i have tghe following data format to manipulate in @array.

17   -.500    -.119     .500    deg    4.3.2/WFOV/Vert
18   -.500    -.034     .500    deg    4.3.2/NFOV/Horiz
19   -.500    -.117     .500    deg    4.3.2/NFOV/Vert
20           -1.032    0.000    deg    4.3.3/Horizontal
21   0.000     .977             deg    4.3.3/Vertical
22    .500    1.216             deg    4.4/Horizontal
23           -1.769    -.500    deg    4.4/Vertical
24   1.000    3.300             deg    4.5/Horizontal
25           -3.265   -1.000    deg    4.5/Vertical

I need to assign six scalars representing each of the fields above. This array is just a sluped txt file.

mabye ->

foreach (@array) { my @split_array = split; my ($testnumber, $llimit, $value, $ulimit, $unit, $name) = @array; }

That is good except some of the columns are empty, either the $llimit, or the $ulimit in the data.(upper or lower limits).

This shifts my data to the left one or two places in the @split_array, and leaves me with usless mixed up scalars that are defined wrong for some of the lines.

I need it to print out like:

TestNum = $testnumber Value = $value Name = $name Ulimit = $ulimit Lli +mit = $llimit.

I have tryed to get around this without asking for help, but it has been a long day of trying diferent ideas.

Thanks in advance.

Kevin

edited: Thu Dec 4 00:21:38 2003 by jeffa - used Perl to remove   chars and br tags, added code and pre tags


In reply to Beginner Question on splitting. by BigSmith

Title:
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, details, 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, summary, 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.