| |
snufse
Posts: 29
Score: 0
Joined: 9/5/2007
Status: offline
|
I need to ftp files and I am using a search pattern. Not sure if I have it correct. I need to ftp only files that starts with "tovecellio" and have extension of ".txt". Here is a exmaple of files int the folder(from where I need to extract as per obove) FTP_Inbound_Files_from_Customer.txt tovecellio_edi.d0419.t142118.txt tovecellio_edi.d0420.t155056.txt tovecellio_edi.d0420.t155056.asc tovecellio_edi.d0824.t124627.txt Present script: strFilePut = "f5508607i" strPattern = "tovecellio.*\.txt" Set objRegExp = New RegExp objRegExp.Pattern = strPattern objRegExp.IgnoreCase = True For Each objFile In fileColl If objRegExp.Test(objFile.Name) Then Set objFSO = CreateObject("Scripting.FileSystemObject") If (objFSO.FileExists(strFTPScriptFileName)) Then objFSO.DeleteFile (strFTPScriptFileName) End If Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True) objMyFile.WriteLine ("ftp -s: " & strFTPServerName) objMyFile.WriteLine ("open " & strFTPServerName) objMyFile.WriteLine (strLoginID) objMyFile.WriteLine (strPassword) objMyFile.WriteLine ("cd " & strFTPServerFolder) objMyFile.WriteLine ("lcd " & strLocalFolderName) objMyFile.WriteLine ("prompt on") objMyFile.WriteLine ("append " & objFile.Name & " " & strFilePut) objMyFile.WriteLine ("disconnect") objMyFile.WriteLine ("bye") objMyFile.Close
|
|