3 Answers
3

I'm posting this variant in the hopes that it will be a little more educational. Otherwise doesn't add anything over Kuba's version.

Generally, parsing can be done using StringCases. You'll need to build up a string expression that describes the pattern of the file name, much the same way you'd write "%d_%s_Polarizer%dDeg-Temp%dK.dpt" when working with scanf. Except here %d is called a NumberString, %s is __, etc. (Note: scanf wouldn't actually work here because it doesn't know that it has to stop reading the %s as soon as it encounters _. scanf doesn't do pattern matching.)

Since it's just a string of atomic constructs, it should be fairly self explanatory.

This basic pattern doesn't account for file names which do not have the -Temp part. Fortunately the fix is easy: just make that part of the pattern optional, i.e. allow it to be [Repeated](http://reference.wolfram.com/mathematica/ref/Repeated .html)zero or 1 times.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.