Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to extrapolate a specific element in a filename
#2
Easiest - with regular expression. if don't want to learn regular expressions, use other string functions, eg findc (to find '{' and '}') and str.get.

Macro Macro2660
Code:
Copy      Help
str var1 = "fileName{topic1}.txt"
str newVar1
if(findrx(var1 "\{(.+?)\}.txt$" 0 1 newVar1 1)<0) end "{...} not found in the string"
out newVar1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)