Formatting files

We currently use the following script to format a non formatted file to an 80 byte format (for grep purposes etc..) We need some assistance with converting the file back to a non formatted file with no carriage returns ( we want the file to be a continuous line)

#!/usr/local/bin/perl

($fn, $len) = @ARGV;

open(IFN, "<$fn") || die "Fail to open $fn\n";
#open(OFN, ">$fn.$len") || die "Fail to open $fn.$len\n";
open(OFN, ">$fn.dat") || die "Fail to open $fn.$len\n";

while (sysread(IFN, $line, $len)) {
print OFN "$line\n";
}
close(IFN);
close(OFN);

Thanks in advance for your assistance :slight_smile:

To remove all line breaks:

tr -d '\n' < inputfile