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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |