timtowtdi - and you should have checked you could open to write! ;-)
#!/usr/bin/perl -w use strict; my $output; open(TEST, 'test.txt') || die "Couldn't open it"; while (<TEST>) { chomp; $output .= sprintf("%s %s\n", (split /,/)[1,0] ) ; } close(TEST); open(TEST, '>test.txt') || die "Couldn't open it"; print TEST $output; close(TEST);
(s)printf tutorial here.
cLive ;-)
--
seek(JOB,$$LA,0);
In reply to Re: Refining my Program
by cLive ;-)
in thread Refining my Program
by EmmittSmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |