- or download this
my $text = do { local $/; <> };
$text =~ tr/\n//d;
$text =~ s/(.{80})/$1\n/g;
$text =~ s/(?!<\n)\z/\n/;
print($text);
- or download this
perl script.pl infile > outfile
- or download this
perl -i.bak script.pl file
- or download this
ISA*00* *00* *28*9000000454 *ZZ*J00370 *
+070926*034
2*U*00401*000489661*0*P*:~GS*HP*9000000454*J00370*20070926*03421826*48
+9660*X*004
...
HN*140079398A~NM1*82*2*GOLDEN LIVINGCENTER FOLEY*****XX*1538110192~NM1
+*TT*2*WPS
- TRICARE FOR LIFE*****PI*000060000~MIA*0***1141.14*MA02**********3***
+**MA44~REF
*EA*0073294416~DTM*050*20070913~DTM*23