0
$\begingroup$

I have many format name files ep00_seq00_sh00 need to make them 00_00_00 in the blender so that they themselves are inserted into the field I need. I can get the file name. But how to cut it is a mystery

enter image description here

$\endgroup$
3
  • 2
    $\begingroup$ can you pls show us what format name files you mean and into what fields you want them insert in? maybe some screenshots? $\endgroup$
    – Chris
    Jun 22 at 12:18
  • $\begingroup$ took screenshots $\endgroup$
    – Welet
    Jun 22 at 13:00
  • 1
    $\begingroup$ Lol I think this is something I would do with a batch script $\endgroup$ Jun 22 at 13:03

1 Answer 1

1
$\begingroup$

Use a regular expression:

import re
name = 'sds01_as02'
print(re.sub(r'[^0-9_]+','',name))
# outputs '01_02'
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.