Re: [MacPerl] Re: [MacPerl-WebCGI] Help in perl formatting a text file

2002-10-29 Thread Bart Lateur
On Tue, 29 Oct 2002 19:32:16 +0200, Detlef Lindenthal wrote: > m'(.{2})(.{7})(.{9})(.{10})([^ ]*)([^,]*),?(?:([^,]*),?)?(.*)'g; > printf "%-3s %-8s %-11s %-11s %-11s %-12s %-12s %-12s %-12s \n",$1, $2, >$3, $4, $5, $6, $7, $8; > printf D_O "%-3s %-8s %-11s %-11s %-11s %-12s %-12s %-12

[MacPerl] Re: [MacPerl-WebCGI] Help in perl formatting a text file

2002-10-29 Thread Detlef Lindenthal
Dear me, you can see what those lines do if you let the script run! And if you want to know more, you have to look up the description for example with Shuck, that is the MacPerl built in help function (put the cursor on some function word and press Command+H). Some description: while () { = rea

Re: [MacPerl] Re: [MacPerl-WebCGI] Help in perl formatting a text file

2002-10-29 Thread Detlef Lindenthal
I have to correct myself; the print lines should read print "$1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\n"; print D_O "$1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\n";

[MacPerl] Re: [MacPerl-WebCGI] Help in perl formatting a text file

2002-10-29 Thread Detlef Lindenthal
### Did you dream of something like this? open (D_I, "Input.dat") or die "Not found" ; open (D_O, ">Output.dat") or die "Cannot write"; while() { chomp; m'(.{2})(.{7})(.{9})(.{10})([^ ]*)([^,]*),?(?:([^,]*),?)?(.*)'g; printf "%-3s %-8s %-11s %-11s %-11s %-12s %-12s %-12s %-12s \n