txtFilePath= "C:\copy.txt"
txtRowNumber=3 '
TextToAdd="three"
Set fso= CreateObject( "scripting.filesystemobject")
Set f=fso.OpenTextFile( txtFilePath, 1)
txtData=f.readall
f.close
Set f=fso.OpenTextFile( txtFilePath, 2)
strTxtData=split( txtData,vbnewline)
For cnt=0 to ubound(strTxtData)
If cnt<>txtRowNumber- 1 Then
f.writeline( strTxtData( cnt))
else
f.writeline( TextToAdd )
End If
Next
f.close
No comments:
Post a Comment