From: Drew Olson Date: 2006-11-30T03:10:41+09:00 Subject: Re: Splitting a CSV file into 40,000 line chunks Thanks for all the responses. As noted in a post above, I am trying to place the headers at the beginning of each split file. Should have mentioned that earlier. Also, regarding the above responses, I am working on a Windows system, hence not being able to use nice shell scripts. Anyway, I seems that my logic was on the right track, the use of ugly counters just made my inner-rubyist upset. Thanks for all the feedback, I will take a look and reading/writing the files using the File object as opposed to the CSV object. In fact, I didn't even think about that. In previous scripts I had been accessing the CSV fields individually but, as it is unnecessary here, I will toy around with performance gains using File object. Speaking of performance, using the code I've described seemed to be quite slow. This is understandable based on the fact that the input file has 1 million+ records, however I was wondering if I would see performance gain by using File objects as opposed to CSV objects. Also, any other tips on increasing the performance of this code would be helpful. Again, thanks for all the responses. I am continually impressed by the attitude and intelligence of this community. -- Posted via http://www.ruby-forum.com/.