Darren D
darren at activebilling.com.au
Wed Feb 13 22:11:59 CST 2008
Hi All I have a tricky question - at least it's tricky for me to solve I have a field in a table where suffixes and prefixes for files are stored in a field called "Possible Matches" Trouble is - it's only one field and the possible prefixes and Suffixes are separated by SemiColons So we may have XML;DOC;TXT;123 etc representing possible Suffix/Prefix What I want to do is write a file copy routine that looks for any occurrence of the strings above in any file name in a given location And I want that routine to copy any occurrence of the file/s it finds with the "Possible Matches" in its name to another folder EG say I have File1.TXT, File2.DOC, 123.PDF, My.INI in the root folder of C:\ I want the routine to find the txt, doc and pdf files and copy them from the root folder of C: to a location but ignore the ini As neither 'INI' nor 'My' (My.INI) is in the "Possible Matches" field The file copy stuff I am familiar with but I think the routine would have to Some other things I am not so familiar with EG PsuedoCode/WorkFlow A Count the items in "Possible Matches" by counting the SemiColons perhaps using InStr (Is that the correct function?) B loop the number of times InStr finds a SemiColon C For each loop build a search string - In this EG "C:\" & "*TXT*" or "C:\" &"*DOC*" etc D The copy every occurrence of "C:\" & "*TXT*" or "C:\" &"*DOC*" etc to the desired destination (This bit I can do) And so on Am I on the right track with the PsuedoCode/WorkFlow? Make sense? Any suggestions? Many thanks in advance DD No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.4/1277 - Release Date: 13/02/2008 8:00 PM