10-24-2015, 08:40 AM
try codes below:
Code:
Set inFile = objFSO.OpenTextFile("test.csv")
Set outFile = objFSO.OpenTextFile("test2.csv.tmp", 2, True)
dim iRowCount
iRowCount =0
Do while not objTextFile.AtEndOfStream
line = inFile.ReadLine
iRowCount = iRowCount + 1
if iRowCount=2 then
arrStr = Split(line, ",")
If arrStr(0) = strFirm Then
soNumber = CInt(arrStr(1))
outFile.WriteLine arrStr(0) & "," & (soNumber + 1)
Else
outFile.WriteLine line
End If
elseif iRowcount>2 then
exit do
end if
Loop
inFile.Close
outFile.Close