Run it like#!/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); }
Saves the original in <file>.bak.% reformat.pl <file>
In reply to Re: Simple Text Conversion
by btrott
in thread Simple Text Conversion
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |