Hello,
I need help with a specific requirement. I have a string like _ABC_2023_001_TENT_BOSTON, which I took from the Smart OCR via RegEx. In the next step, I would like to use a VBS script and RegEx to check whether a folder with the unique name _ABC_2023_001_ exists.
If so, the file should be placed in the folder like _ABC_2023_001_XXXX XXXX. The customer is unsure whether the end of the character string is always unique.
If not, the file will be directed to a different path. So far I've gotten this far:
dim objFSO, objFolder, objSubFolder, objRegExp
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call CheckFolders("D:\OUTPUT\PROJECTS\")
Set objRegExp = New RegExp
objRegExp.Pattern = "_ABC_\d{4}_\d{3}_"
Sub CheckFolders(strPath)
Set objFolder = objFSO.GetFolder(strPath)
For Each objSubFolder In objFolder.SubFolders
If objRegExp.Test(objSubFolder.Name) Then
.................
else
................
End Sub
Can anyone help me on this?
Thanks in advance,
Greetings Michael