Sep-15-2022, 11:23 AM
(This post was last modified: Sep-15-2022, 11:57 AM by Yoriz.
Edit Reason: Added code tags
)
Hi Team,
how to delete below files from a folder
which contains word sql_Table1
sql_Table1.csv
sql_Table1.gzip
Chksum_sql_Table1_20220806
how to delete below files from a folder
which contains word sql_Table1
sql_Table1.csv
sql_Table1.gzip
Chksum_sql_Table1_20220806
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import os import os.path def dbs_remove(folderpath,table) file = f '{tbl}.csv' fname = os.path.join(folderpath,tbl) print ( file ) if os.path.exists(fname): os.remove(fname) else : print ( 'Path not found' ) if __name__ = = "__main__" : #tbl = "sql_Table1" tbl = input ( "Enter TableName" ) folderpath = "E:\\test\reports" |