1) Use string parser with . as delimiter
OR
use the left function to get all characters between the first and the one before . (might need to get the length of the filename first to do that)
2) use the right$ function to check the last 3 characters of the filename
Mid$, Right$ and Left$ are string functions found in the expression editor. Right$ and Left$ allow you to enter a string and a number, and return that many characters from the relevant end of the string. Mid$ does the same thing but you also enter a number equivalent to the starting point, so it returns a specified number of characters from a specified point in the string.
I don't know if what Joe said is going to help you with your problem though since I haven't tested it, so don't take this as an endorsement. Just an explanation.
Instead of loading the files using the Tree Control, load them into a List Object.
ex:
* Start Of Frame
- List: Load filelist from "Folder\*.txt"
- Start loop "Loop" List Nb Lines ("List") times
- List: Destroy
* On loop "Loop"
- Tree Control: Insert Item ( Left$( List Line Text$("List", LoopIndex("Loop") ), Len( List Line Text$("List", LoopIndex("Loop") ) ) - 4 ) ), -1, -2 )
The insert item expression takes all characters except the last 4 and adds them to the Tree Control