related to Substring of filename in LaTeX and extract number from \jobname as counter .
I am naming my filenames as 01-text1.tex, 02-something.tex, 03-blah.tex and so on. I would like to set my section counter according to the first two letters (digits). something like
\setcounter{section}{\StrLeft{\jobname}{2}}
\addtocounter{section}{-1}
this was less than successful, probably catcodes :-(. can someone please recommend the magical invokation that works?