use strict; use warnings; open (FF,"filename.txt"); # assume file is having 6 lines @array=<FF>; open (FF1,">file2write.txt"); for ($i=0;$i<=6;$i++) { if($i%2==0) { print FF1, @array[$i+1]; } if ($i%2==1) { print FF1,@array[$i-1]; }
In reply to Re^2: to interchange line no of file & print
by harshmane
in thread to interchange line no of file & print
by harshmane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |