Jan-16-2021, 02:27 AM
Greetings and happy Friday!
I'm scanning Network Shares and collecting file names if they have a digit in the name.
I can get the list of all File names but cannot filter (print out) only the ones with the Digit/Digits in the name.
And that is what I need.
Here is part of the code I have a problem with:
"Matched - <re.Match object; span=(10, 11), match='1'>"
Thank you.
I'm scanning Network Shares and collecting file names if they have a digit in the name.
I can get the list of all File names but cannot filter (print out) only the ones with the Digit/Digits in the name.
And that is what I need.
Here is part of the code I have a problem with:
import re
import os
ech = 'C:/Users/sys/Desktop/01/'
for root,dirs, files in os.walk(ech):
#print (files)
for fls in files :
print (fls)
m = re.search(r'\d', fls)
print ("Matched - ",m)I'd like to print the whole file name but I managed to print this instead:"Matched - <re.Match object; span=(10, 11), match='1'>"
Thank you.
