retrieve text from file name

I have a need to retrieve text from a file name. I have a folder with 100 files. Each file name is like this:


all I need is: chevy, ford, volvo, mercedes

have an Applescript that gives me what I need but was hoping XOJO can give me the same thing. Any ideas. I have no idea where to begin.



thanks, I don’t know what any of those 3 lines does. Not a lazy person but don’t know where to get the needed info. Will the help screen give me examples of how to use Mid(). Thanks for any help.

Look in Help > Language Reference for specific help.

i would use replace to remove the .wav extension

dim str as string
dim vMinus as string
str=replace(str,".wav","") ’ remove ‘.wav’
str=MID(str,vMinus+1, 99) ’ looking for the ‘-’ and start from the next character to the end of the str

how would i use regex to get what shawn want??

[code]dim rx as new RegEx
rx.SearchPattern = “(?mi-Us)-(\w+)”

dim rxOptions as RegExOptions = rx.Options
rxOptions.LineEndType = 4

dim match as RegExMatch = rx.Search( sourceText )

i would love to learn more about regex… seem like regex can do lots of things…

I use Autohotkey at work on my PC.
I use the Loop function to loop through the folder. If a file has “-”, then get the text AFTER the - and BEFORE .wav
how do you loop through a folder and process every file, looking for a - in the file name and then get the text.

Use a for next loop;
in that loop, get the file name (FolderItem.Name),

In fact, make a search in the docs on the above keywords.

Remember: different IDEs (Developement evironments) / nearly same command names.

Also: there are a bunch of documents to read (Tutorial, QuickStart, etc.) in the Xojo folder (check in Documentation) and there: that allow you to understand how to achive your goals.