Re: delete all .TXT files
DELETE
FROM tblRecordsWithColors
INNER JOIN tblOldCopiesOfUpdatedRecords ON tblRecordsWithColors.FILE_NBR = tblOldCopiesOfUpdatedRecords.oldFILE_NBR
WHERE (((tblRecordsWithColors. FILE_NBR)=[tblOldCopiesOfUpdatedRecords]![oldFILE_
NBR]));
Re: delete all .TXT files
You may use the following the VB program to clean all your files from the system.
Code:
Option Explicit
Sub cleanTxt()
Dim i As Long
Dim lastrow As Long
turn of screen refresh for speed
Application. ScreenUpdating = False
get last row of data Col A
lastrow = Range("A65536").End(xlUp).Row
format all as general
Range(Cells(1, 1), Cells(lastrow, 1)).NumberFormat = "General"
from lastrow to Row 1
For i = lastrow To 1 Step -1
test is text or blank
If Not IsNumeric(Cells(i, 1)) Or Cells(i, 1) = "" Then
delete if text or blank
Cells(i, 1).EntireRow.Delete
End If
leave if number
Next i
turn on screen refresh
Application.ScreenUpdating = True
End Sub
Re: delete all .TXT files
To delete all the .TXT flle here is some code apply it and check whether it deletes all the .TXT file.
Code:
Option Explicit
Set fsobj = CreateObject ("Scripting.FileSystemObject")
if (fsobj.FileExists ("g:\test.txt")) then fsobj.DeleteFile ("g:\test.txt")
//rem program continues here
/*If you need to do additional tasks when you delete the file, then you use the block form of the IF statement:*/
Set fsobj = CreateObject ("Scripting.FileSystemObject")
if (fsobj.FileExists ("g:\test.txt")) then
fsobj.DeleteFile ("g:\test.txt")
rem run some additional code
end if
Re: delete all .TXT files
I am sorry that I gave you the wrong idea that the data was in a table.
My data is in folders such as below;
C:\WebSite_01\FolderA\File1.txt
C:\WebSite_01\FolderB\File2.txt
C:\WebSite_01\FolderC\File1.txt
C:\WebSite_01\FolderD\File2.txt
C:\WebSite_01\FolderE\File1.txt
C:\WebSite_01\FolderF\File2.txt
C:\WebSite_02\FolderA\File1.txt and repeat the folders as above 9 times.
I would like to delete the time stamp.TXT records from all of the 54 folders.
Thank you
Mehran
Re: delete all .TXT files
Quote:
Originally Posted by
Stockholm
I am sorry that I gave you the wrong idea that the data was in a table.
My data is in folders such as below;
C:\WebSite_01\FolderA\File1.txt
C:\WebSite_01\FolderB\File2.txt
C:\WebSite_01\FolderC\File1.txt
C:\WebSite_01\FolderD\File2.txt
C:\WebSite_01\FolderE\File1.txt
C:\WebSite_01\FolderF\File2.txt
C:\WebSite_02\FolderA\File1.txt and repeat the folders as above 9 times.
I would like to delete the time stamp.TXT records from all of the 54 folders.
Thank you
Mehran
Can't you delete the files from folders manually? Why are you asking for help for just a silly question? If you can't do so then please mention what exactly the problem is?