FTP Host File Spec??

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Bubs
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 2:52 pm

FTP Host File Spec??

Post by Bubs » Thu Apr 30, 2009 7:53 pm

Hi

I'm having some trouble with getting FTPGetdirlist and FTPGetFile to work how I need.

I'm requesting for a single file (or a mask e.g. xx_*.csv) and I always get the whole contents of the directory downloaded.

I'm running 11.1.08a on XP-Pro

Any ideas? All help gratefully received

Cheers

Bubs



:(

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 01, 2009 1:46 am

Please provide the code you are using.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

wildcard support is limited

Post by gdyvig » Fri May 01, 2009 2:38 am

Wildcard support is limited for filespecs.

In the examples, you will see /*.txt but not /xx_*.txt.

See this related posting:

http://www.mjtnet.com/usergroup/viewtop ... 569b388141

The above post was written before the RegEx function was made available which would simplify the solution even more.

Another note on wildcards:

Wildcard support is also limited for windows, but in a different way, it means "contains"

//window name is "What part does wildcard match?"
//You may think this is correct
SetFocus>*part*
//But this is what works:
SetFocus>part*

You might want to see if the asterisk means "contains" for filespecs too. I don't think it does, but let us know what you find.


Gale

Bubs
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 2:52 pm

This is the code ..

Post by Bubs » Fri May 01, 2009 8:32 am

//Set paths etc
Let>FileDir=s:\dev\work\
Let>Server=system_live
Let>ServerDir=/spool/ab/

// Get the list of files
FTPGetdirlist>%Server%,xxxx,default,21,%FileDir%dirlist.txt,%ServerDir%,%ServerDir%XP*.csv,L

Also tried ...

FTPGetdirlist>%Server%,xxxx,default,21,%FileDir%dirlist.txt,%ServerDir%,XP*.csv,L

But both cases bring back a complete listing not just files starting with XP.
Get file is similar but requesting for a single named file downloads the whole directory a file at a time into the local file, ending up with the contents being last file downloaded.

Thanks for helping

Bubs

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

For more granual filtering, must filter the output.

Post by gdyvig » Fri May 01, 2009 1:25 pm

Try:

FTPGetdirlist>%Server%,xxxx,default,21,%FileDir%dirlist.txt,%ServerDir%,*.csv,L

Then filter the output file as shown in the link I provided earlier or using RegEx.

Gale

Bubs
Newbie
Posts: 3
Joined: Thu Apr 30, 2009 2:52 pm

Thanks For the help

Post by Bubs » Tue May 05, 2009 12:25 pm

Thanks for the help guys.

I've managed to get around what I was trying to do by doing the FTPGetDirList to a file (filter by *.csv helps by cutting a possible long directory down) then using readfile to get the whole thing into a variable and using position to see if a specific file exists.

All works wonderfully now, meaning I no longer have to get up at 5:30am to see if something has happened.

Thankyou thankyou

Bubs :D

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts