I have wrote a function to combine MS Word file from a specified directory into one file. However, it combines the files alphabetically, and this is not what I want. I have custom sorting rules that need to be used. Here they are...
The sort is driven by a string in the file name bounded by the first hyphen from the left, e.g. for the file 06CP02MajDep-ET_pre the sort is driven by the string beginning –ET_
Not every term in the list below will have a file. Some terms may have greater than 1 (and an alpha sort may be used in that case).
-Info_
-TOC_
-AB_
-ES_
-FES
-Intro_
-EtioPath_
-EtioPath-LP
-Epi_
-Epi-LP
-CT_
-CT-LP
-MP_
-MP-LP
-UN_
-UN-LP
-ET_
-ET-LP
-MKT_
-MKT-LP
-TM
-PL_
-Meth_
-BB_
-T0
-T1
-T2
-T3
-T4
-F0
-F1
-F2
All Others
That is the order of the sort. I was wondering if someone can point me in the right direction (as to what class to use) or give me an example of how to start this?
Thanks
The sort is driven by a string in the file name bounded by the first hyphen from the left, e.g. for the file 06CP02MajDep-ET_pre the sort is driven by the string beginning –ET_
Not every term in the list below will have a file. Some terms may have greater than 1 (and an alpha sort may be used in that case).
-Info_
-TOC_
-AB_
-ES_
-FES
-Intro_
-EtioPath_
-EtioPath-LP
-Epi_
-Epi-LP
-CT_
-CT-LP
-MP_
-MP-LP
-UN_
-UN-LP
-ET_
-ET-LP
-MKT_
-MKT-LP
-TM
-PL_
-Meth_
-BB_
-T0
-T1
-T2
-T3
-T4
-F0
-F1
-F2
All Others
That is the order of the sort. I was wondering if someone can point me in the right direction (as to what class to use) or give me an example of how to start this?
Thanks