|
VBScriptでADBDB.Streamを使って「一行ずつ」と「残り一括」を比較したら、雲泥の差でしたよ。
Option Explicit
'On Error Resume Next
Const adTypeText = 2
Const adCRLF = -1
Const adLF = 10
Const adCR = 13
Const adReadAll = -1
Const adReadLine = -2
Const adWriteLine = 1
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
dim i, istream, ostream, s
s = Now()
Set istream = WScript.CreateObject("ADODB.Stream")
Set ostream = WScript.CreateObject("ADODB.Stream")
With ostream
.Type = adTypeText
.Charset = "shift-jis"
.LineSeparator = adCRLF
.Open
End With
With istream
.Type = adTypeText
.Charset = "shift-jis"
.LineSeparator = adCRLF
.Open
.LoadFromFile "C:\temp\input.csv"
For i = 1 to 1000
.SkipLine
Next
' Do While not .EOS
' ostream.WriteText .ReadText(adReadLine), adWriteLine
' Loop
'↑↓どちらかを有効にして速度を計ってください
' .CopyTo ostream
.Close
End With
ostream.SaveToFile "C:\temp\output.csv", adSaveCreateOverWrite
ostream.Close
Set istream = Nothing
Set ostream = Nothing
Msgbox FormatDateTime(Now() - s)
|