Thinking about it, you're probably right - hiding the EOLs in $J is a
bit obscure if the OP is new to perl, so:


open (O, "<Old_File.txt") or die;
open (N, ">New_File.txt") or die;

while (<O>) {
        chomp;
        ($A, $B, $C, $D, $E, $F, $G, $H, $I, $J, $extras) = split /,/, $_,
11;
        die "whoops, too many fields" if $extras;
        print N "$A,$B,$C,$D,$I,$J\n";
        print N "$A,$B,$E,$F,$I,$J\n";
        print N "$A,$B,$G,$H,$I,$J\n";
}


Steve.


-- 
SteveEast
------------------------------------------------------------------------
SteveEast's Profile: http://forums.slimdevices.com/member.php?userid=4193
View this thread: http://forums.slimdevices.com/showthread.php?t=23777

_______________________________________________
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to