11-05-2011, 02:09 PM
Join Date: Jul 2010
OS: DOS 3.3
Taking a cue from jcgriff2 here is a VB script you can try:
Dim objFSO, readlines, writelines
Dim toReadFile, toWriteFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
toReadFile = "readfile.txt"
toWriteFile = "writefile.txt"
readlines = Split(objFSO.OpenTextFile(toReadFile).ReadAll, vbNewLine)
writelines = Split(objFSO.OpenTextFile(toWriteFile).ReadAll, vbNewLine)
For i = 2500 To 3500
writelines(i-1) = readlines(i-1)
objFSO.OpenTextFile(toWriteFile, 2).WriteLine Join(writelines, vbNewLine)
Where your MASTER file is the writefile.txt and your SLAVE file is the readfile.txt
Where i = 2500 To 3500 are the lines 2500-3500
(Note that the lines are written into an array that starts with writelines(0) and readlines(0)
and that is why you use writelines(i-1) and readlines(i-1) )
Also note that text files are very small so you should not have a memory problem. The text files I used are about 400kilobytes in size and have 4500 lines of 80digit numbers. Since there are 2 files it will only read about 800kilobytes into memory - which is hardly anything.
Please make copies of your MASTER and SLAVE files before testing this.