Notifications
Clear all

[Closed] Getting access to specific digits in file name

Hey

a quick question .

im running this code

Shot=maxFileName
print Shot
Shot.count

and i want to get access to the File name so i can extract only specific data from it .

that is the name of the file “Sh 44_Ep France_Anim16.max”

so i want Shot to be = 44
Shot=44

then im using it as a prefix to my render outputs

and getting it every time for a different shot .

can anyone advise ?

thanks

2 Replies

If you are sure the shot number will always be on the same position you can use filterString, something like:

nameParts = filterstring maxFileName " _"
shot = nameParts[2]

Yes ,the numbers will always be in the same place .

Thanks Codi