Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


FTP according to a search pattern

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64109
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> FTP according to a search pattern
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 FTP according to a search pattern - 9/8/2008 12:59:52 AM   
  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
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> FTP according to a search pattern Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts