How to extract selected text in text wave
randomz_raf
I wondering how I can extract selecting text in my text wave.
For example, I have this text in my text wave: 20141114_153532RGB.tif . How can I select only '153532' in my text wave and convert the selected text into numeric value?
Thank you in advance for your help.
// Print ExtractNumberFromFileName("20141114_153532RGB.tif")
// Returns 153532.
Function ExtractNumberFromFileName(fileName)
String fileName // e.g., 20141114_153532RGB.tif
Variable val1, val2
sscanf fileName, "%g_%g", val1, val2
return val2
End
November 18, 2014 at 09:28 pm - Permalink