As part of a bigger code I am trying to split a file name string so that I can use the base number to search for a file in a set of folders.
The typical file names are:
TEST-999-TY-MOD-DOC-000999-SOME RANDOM FILE NAME.xls TEST-999-TY-MOD-DOC-000998_SOME RANDOM FILE NAME.xls TEST-999-TY-MOD-DOC-000997 SOME RANDOM FILE NAME.xls TEST-999-TYP-MOD-DOC-000999-SOME RANDOM FILE NAME.xls TEST-999-TYP-MOD-DOC-000998_SOME RANDOM FILE NAME.xls TEST-999-TYP-MOD-DOC-000997 SOME RANDOM FILE NAME.xls The only thing in those file names that doesn't change is the 6 digit format in the 6th section Is there a way that I can use the split function on all of these file names to only have the base name of
TEST-999-TY-MOD-DOC-000999 If they were all the same length then I could use the left function but because it changes and they are not consistant with what they use further down the file name i'm struggling
cheers