i have a file that has a huge numbers of lines and each line contains 5 numbers 1st is an x value and the following 4 are y values. i want to read each value into a different array so that by the end of the file i will have an array of x values and 4 arrays of y values.
i was told by another source that i could use a foreach loop to state that i wanted it to go through each line and then get an array of each line with a split(/ /) command
the only problem is that i have no idea how to get a foreach loop to go line by line.
i dont need it to store these values for any longer than it takes for it to find a max and a min for the x and a max for each y
all numbers are in a 0.00000000E00 config and there are negatives present.
what would be the most graceful way that anyone can think of to get through this.
any suggestion would be much appreciated.
Restored paragraph div's - dvergin 2002-07-03
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.