Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to update CSV File and need to Save same CSV File
#2
Not Solved
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
Reply


Messages In This Thread
RE: How to update CSV File and need to Save same CSV File - by tigerliew - 10-24-2015, 08:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is VBScripting disabled in Office 365 update? soumyarani 0 1,534 12-19-2020, 12:37 PM
Last Post: soumyarani
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,466 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Comapre txt file with different number of lines anushreebehura 0 1,746 06-02-2015, 06:28 PM
Last Post: anushreebehura
  How to read a text file using FSO from bottom to up order?? vallalarasu.p 0 2,510 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  How to find a file after downloading UFT_Newbie 1 2,973 09-18-2014, 08:43 PM
Last Post: UFT_Newbie

Forum Jump:


Users browsing this thread: 1 Guest(s)