' **********************************************************' オブジェクト作成' **********************************************************
Set Fs = CreateObject( "Scripting.FileSystemObject" )
Set Lbox = CreateObject( "Lbox.BatchHelper" )
' **********************************************************' ターゲット ファイル' **********************************************************
InFile = Lbox.OpenFileName()
if InFile = "" then
Lbox.MsgOk( "入力ファイル選択でキャンセルされました" )
Wscript.Quit
end if
OutFile = Lbox.SaveFileName()
if OutFile = "" then
Lbox.MsgOk( "出力ファイル選択でキャンセルされました" )
Wscript.Quit
end if
' **********************************************************' ファイルオープン' **********************************************************
on error resume next
Set InObj = Fs.OpenTextFile( InFile, 1 )
if Err.Number <> 0 then
Lbox.MsgOk( Err.Description )
Wscript.Quit
end if
on error goto 0
Set OutObj = Fs.OpenTextFile( OutFile, 2, True )
' **********************************************************' 処理' **********************************************************
Do While not InObj.AtEndOfStream
Buffer = InObj.ReadLine
OutObj.WriteLine Buffer
Loop
' **********************************************************' ファイルクローズ' **********************************************************
OutObj.Close
InObj.Close