rendier,
Why can't you still use one of the CSV modules? My experience with Text::CSV for instance tells me you can read the one long line into an @fields array and then process @fields in groups of N. Of course, you will want to write the file back out correctly so that you only have to go through this exercise once.