Re: Need to change file columns

2002-12-21 Thread Ashutosh Jog
Hey, Thanks a ton. The method that I was using was disturbing the formatting, but this did the trick. -Cheers. Rob Dixon wrote: I don't really like providing 'instant solutions', but I'm feeling too lazy to help you to your own solution! This should do the trick, with the disclaimer that I hav

Re: Need to change file columns

2002-12-21 Thread LRMK
# this must get the job done open (FH,'; close(FH); chomp @recs; $c=-1; while ($c<$#recs){ $c++; @parts = split(/\s+/,$recs[$c]); $recs[$c] = "$parts[1] $parts[0]"; } open (FH,'>filename'); select(FH); foreach $line (@recs){ print "$line\n"; } close(FH); - Original Message - From

Re: Need to change file columns

2002-12-21 Thread Rob Dixon
I don't really like providing 'instant solutions', but I'm feeling too lazy to help you to your own solution! This should do the trick, with the disclaimer that I haven't tested it in any way. open INP, "< inp.txt"; open OUT, "> out.txt"; printf OUT "%-10s%s\n", reverse split while ()