Jul-07-2020, 10:49 PM
@ DeaD_EyE
Wow, I can't pretend to understand it, but it works great! Thanks very much! I had a feeling there was a better way to do this!
I've tried to understand re, but it is very cryptic. I do use re to take words out of texts and leave gaps, but that's all!
My (unsorted) file names are like this: 'CE3_1_page_29.pdf', 'CE3_1_page_41.pdf', 'CE3_1_page_28.pdf', 'CE3_1_page_14.pdf'
I didn't know if I needed the whole name or not, so I tried:
match = re.search(r"CE3_(\d+)_page_(\d+)", pdf) and match = re.search(r"CE3_(\d+)_page_(\d+).pdf", pdf)
Both worked!
Now all I have to do is try and understand it!
@snippsat Thanks, I'll fetch natsort and try to use it! Thanks!
Wow, I can't pretend to understand it, but it works great! Thanks very much! I had a feeling there was a better way to do this!
I've tried to understand re, but it is very cryptic. I do use re to take words out of texts and leave gaps, but that's all!
My (unsorted) file names are like this: 'CE3_1_page_29.pdf', 'CE3_1_page_41.pdf', 'CE3_1_page_28.pdf', 'CE3_1_page_14.pdf'
I didn't know if I needed the whole name or not, so I tried:
match = re.search(r"CE3_(\d+)_page_(\d+)", pdf) and match = re.search(r"CE3_(\d+)_page_(\d+).pdf", pdf)
Both worked!
Now all I have to do is try and understand it!
@snippsat Thanks, I'll fetch natsort and try to use it! Thanks!