GetFileList returns backslash

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

GetFileList returns backslash

Post by tony_smith » Tue Jul 12, 2005 5:19 pm

I can't get the GetFileList command to return files names without each file having a backslash "\" in front of it.

I have two files in the directory NEW_OUT; A001.csv and A002.csv. When I run...

Cha>U:\EData\SIL_FTP\Dunn\VMI\NEW_OUT\
GetFileList>*.csv,files
Separate>files,;,file_names

The result of GetFileList is; FILES=\A001.csv;\A002.csv
and...
Separate yields \A001.csv and \A002.csv

I have tried changing file extensions and the separator, but the results do not change.

Can anyone help with this?

T

User avatar
JRL
Automation Wizard
Posts: 3531
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jul 12, 2005 5:33 pm

Tony,

Try using the stringreplace function to remove the backslashes before you do your seperate. Something like this:

Cha>U:\EData\SIL_FTP\Dunn\VMI\NEW_OUT\
GetFileList>*.csv,files

Let>bslash=\
Let>null=
StringReplace>files,%bslash%,%null%,newfiles

Separate>newfiles,;,file_names

Note that there is nothing beyond the equal sign in the "Let>null=" line.

Hope this helps,
Dick

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Tue Jul 12, 2005 6:18 pm

Ah, yes. Thanks for the help, Dick... I will give it a whirl.

MJT folks... is this one for the bug list?

Tony

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Jul 12, 2005 8:08 pm

I think it is just a result of you changing directory first. If you specify the full path in GetFileList you get the full path to each file which is how it is supposed to work. Maybe an option to return full path OR filename only is called for.
MJT Net Support
[email protected]

User avatar
tony_smith
Pro Scripter
Posts: 70
Joined: Wed May 14, 2003 8:25 pm
Location: Vancouver BC Canada

Post by tony_smith » Tue Jul 12, 2005 8:58 pm

That would help. This is the first time I have used the command in this context, needing only the file names. It would be nice to have.

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