E:\test>c:\DELL\bin\perl5.8.6.exe -e"BEGIN{ open $fh[$_],'>','split.'.$_ for 0..9 }" -nle"print {$fh[substr $_,3,1]} $_" junk.log E:\test>dir Volume in drive E is New Volume Volume Serial Number is 1821-B83A Directory of E:\test 28/01/2015 02:20 . 28/01/2015 02:20 .. 28/01/2015 02:13 1,900 junk.log 28/01/2015 02:20 190 split.0 28/01/2015 02:20 190 split.1 28/01/2015 02:20 190 split.2 28/01/2015 02:20 190 split.3 28/01/2015 02:20 190 split.4 28/01/2015 02:20 190 split.5 28/01/2015 02:20 190 split.6 28/01/2015 02:20 190 split.7 28/01/2015 02:20 190 split.8 28/01/2015 02:20 190 split.9 11 File(s) 3,800 bytes 2 Dir(s) 1,624,181,084,160 bytes free