jessiejane
Programmer
I have a text file in the format of "Name-Date"
Sample of the text file:
John-02/03/2010
Mary-05/20/2010
When the date meets the 60 day counter then the record should be deleted from the text file and any spaces in the text file should be removed.
(I have converted the text file from array to string format for other reasons so I am spliting the text file)
strData = objFSO.OpenTextFile(Path & strFile, 1).ReadAll
'Split the text file into lines
arrLines = Split(strData,vbCrLf)
For Each strLine in arrLines
DateValue = Mid(strLine,instr(strLine, "-")+1)
Days = DateDiff("d", CDate(DateValue), todayDate)
if Days >=60
' How would I delete the record from a file'
?????????????????????????????????????? and remove
blank lines.
end if
Any help is appreciated.
Sample of the text file:
John-02/03/2010
Mary-05/20/2010
When the date meets the 60 day counter then the record should be deleted from the text file and any spaces in the text file should be removed.
(I have converted the text file from array to string format for other reasons so I am spliting the text file)
strData = objFSO.OpenTextFile(Path & strFile, 1).ReadAll
'Split the text file into lines
arrLines = Split(strData,vbCrLf)
For Each strLine in arrLines
DateValue = Mid(strLine,instr(strLine, "-")+1)
Days = DateDiff("d", CDate(DateValue), todayDate)
if Days >=60
' How would I delete the record from a file'
?????????????????????????????????????? and remove
blank lines.
end if
Any help is appreciated.