Ok, this did not work, but I have a new idea. From the top.... 1)Read in the csv file, take the first 18 records and insert them into a temp db. Ie: $output = array_slice ($fields, 0, 17);
2)Then do a count on the line to see how many records are after 17 and somehow loop through them 34 at a time. It is easy if there is only one set, but I am not sure how to take the remaining elements in the array and break them out 34 at a time until I reach the end of the line. Help, my head hurts and I have a habit of over thinking :) -Scott -----Original Message----- From: Mark Heintz PHP Mailing Lists [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 4:43 PM To: Scott Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Parsing file's You may have been heading in the right direction originally with array_slice... This is off the top of my head, I don't guaruntee it will work... $start = 34; $interval = 15; $max = 303; // hop across orig. array 15 columns at a time for($offset = $start; $offset < $max && isset($array[$offset]); $offset += $interval){ // slice off $interval many columns starting at $offset $sub_array = array_slice($array, $i, $interval); // handle your $interval many key-value pairs foreach ($sub_array as $key => $value){ $policyWriter = "$quoteKey|$key|$value"; // ... } } mh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php