Add quotes to filenames

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gonnics
Newbie
Posts: 2
Joined: Tue Mar 31, 2015 3:09 pm

Add quotes to filenames

Post by gonnics » Tue Mar 31, 2015 9:58 pm

I need to surround the filenames with quotes in order to put them in an input box. How can I do this?
When I run the following it gives me the names of the files but I have tried several ways to add leading and trailing quotations on the filenames without luck.

GetFileList>c:\test\*.*,files
Separate>files,,file_names
MessageModal>files

Which would give me something like: c\test\file_1.txt;c\test\file_2.txt;c\test\file_3.txt;
I need it to be "c\test\file_1.txt" "c\test\file_2.txt" "c\test\file_3.txt"
Any help would be greatly appreciated.

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

Re: Add quotes to filenames

Post by JRL » Wed Apr 01, 2015 2:23 pm

Something like this should work for you. Note that there is a semicolon as the "delimiter" parameter for the separate> function because that is the default output of the GetFileList> function.

Code: Select all

GetFileList>c:\test\*.*,files
Separate>files,;,file_names

Let>kk=0
Repeat>kk
  Add>kk,1
  Let>value=file_names_%kk%
  Let>Value="%value%"
  MDL>value
Until>kk=file_names_count

gonnics
Newbie
Posts: 2
Joined: Tue Mar 31, 2015 3:09 pm

Re: Add quotes to filenames

Post by gonnics » Thu Apr 02, 2015 8:35 pm

This worked. Thank you very much

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