Created
July 30, 2018 20:45
-
-
Save discarn8/1379e650852c297a1c6e308e440fd3f5 to your computer and use it in GitHub Desktop.
Python_list_specific_filetypes_with_mod-date_in_directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
#import glob | |
#import time | |
path = "C:/path/to?files/*.csv" | |
for fname in glob.glob(path): | |
temp1=os.path.basename(os.path.normpath(fname)) | |
filename=temp1.split('.')[0] | |
dt=time.strftime('%Y%m%d', time.gmtime(os.path.getmtime(fname))) | |
print(filename+","+dt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment