in reply to Converting fixed record length files to pipe delimited

Basic Technique: read the records in, trim them, then use perlfunc:join to generate the output form. Probably your best bet is to read in each line, put all the 'keeper' fields into an array, then loop through the array and print the joined array out to a file. Here's one, relatively easily grokkable way to do it:

# for each line, # get fields you're keeping, put them into @fields # in the proper order foreach my $field (@fields) { $field =~ s/^\s*(.*?)\s*$/; # trim whitespace -- but beware! # two-command version (see the FAQ in perlfaq) # $field =~ s/^\s*//; # $field =~ s/\s*$//; } print OUTPUTFILEHANDLE join "|" @fields; # now process the next line

HTH

Philosophy can be made out of anything. Or less -- Jerry A. Fodor