i am using glob.glob('') function to get a list of all files from a folder. I need to get only those names which do not contain '_ab' in it. How is it possible. I understand the need for regular expressions here. i tried (?!....) . what should work here.
example :
x = glob.glob('c:\temp\*ab*')
this returns all files containing ab in it. What should i write here so that it returns only those that do not contain ab in it
i am using glob.glob('') function to get a list of all files from a folder. I need to get only those names which do not contain '_ab' in it. How is it possible. I understand the need for regular expressions here. i tried (?!....) . what should work here.
example :
x = glob.glob('c:\temp\*ab*')
this returns all files containing ab in it. What should i write here so that it returns only those that do not contain ab in it
Brgds,
kNish
You can use a list comprehension to exclude files with '_ab' in the names.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.