in reply to Simple Text Conversion

Here's another:
#!/usr/local/bin/perl -wi.bak use strict; my @recs; while (<>) { chomp; push @{$recs[int(($.-1) / 5)]}, split /,?\s/; print map join('|', @$_) . "\n", $recs[int($.-1) / 5] if !($. % 5); }
Run it like
% reformat.pl <file>
Saves the original in <file>.bak.