
7stud
Enthusiast
Mar 21, 2010, 2:47 AM
Views: 540
|
|
Re: [jonny5509] Array problem
|
|
|
At the moment, Im splitting each line on space and storing the values in an array, doing a scalar on the line array to get the number of values per line, which is fine, but how do I then add each value to a new array until it reaches the desired number, and then start on the next array? split(), print(), count: split() a line into an array, then print() the numbers in the array one by one, and count after you print. After counting, use the modulus operator to tell you when to print a newline:
if ( ($count % 6) == 0) { print "\n"} Easy, peasy.
(This post was edited by 7stud on Mar 21, 2010, 2:50 AM)
|