Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to update CSV File and need to Save same CSV File
#1
Hi Team,

I want to update CSV file by modifying some data based on column. In Row 2 or 3. And need to save same CSV File. Can you please help me in same
Reply
#2
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is VBScripting disabled in Office 365 update? soumyarani 0 2,040 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,853 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Comapre txt file with different number of lines anushreebehura 0 2,090 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,879 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  How to find a file after downloading UFT_Newbie 1 3,390 09-18-2014, 08:43 PM
Last Post: UFT_Newbie

Forum Jump:


Users browsing this thread: 3 Guest(s)