in reply to Re: How to Modify Each file??
in thread How to Modify Each file??

can you please help me out with code in reading writing into output

Replies are listed 'Best First'.
Re^3: How to Modify Each file??
by downer (Monk) on Oct 21, 2007 at 04:39 UTC
    something very rough with some details left out
    opendir THISDIR, 'whatever/thisdir'; my @files = readdir(THISDIR); foreach my $x (@FILES){ open READFILE, "whatever/thisdir/$x"; open WRITEFILE, ">whatever/thatdir/$x"; while(<READFILE>){ chomp; my @parts = split(/\s/, $_); print WRITEFILE $parts[1], " ", $parts[0], "\n"; } close WRITEFILE; close READFILE; }