[Done] Ability to Choose Delimiter in GetFileList> Comman

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply

Allow us to Choose our own Delimiter in GetFileList> Command

5. Important, even if the size/efficiency increases/degrades
1
33%
4. Somewhat important
2
67%
3. I'm okay either way
0
No votes
2. Somewhat unimportant
0
No votes
1. Unimportant, even if the size/efficiency remains unaffected
0
No votes
 
Total votes: 3

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

[Done] Ability to Choose Delimiter in GetFileList> Comman

Post by jpuziano » Sat Oct 30, 2004 12:13 am

Consider these two commands that are often used together:

1. GetFileList>filespec,result

2. Separate>list,delimiter,returnvar

- The first imposes a semicolon ; as the delimiter :(
- The second let's us choose our own delimiter :)

Semicolon ; is a valid char in a filename so if you have filenames
full of semicolons, Separate> isn't going to do you much good.

Could GetFileList> be enhanced to let us choose our own delimiter?

GetFileList>filespec,result,delimiter

Then we could just choose a delimiter that's not a valid character in
a filename and the Separate> command would work perfectly every time.

If you added the delimiter at the end and made it optional, you'd even
keep backward compatibility, default could still be the semicolon ;
unless something else was specified.

Anyone else run into this problem? If so, how did you get around it?

Oh, and a big thanks to Bob Hansen, Lumumba, Marcus and others...
I've learned a lot from your posts in the Forums here.
Last edited by jpuziano on Sat Sep 27, 2008 7:19 am, edited 7 times in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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 » Sat Oct 30, 2004 4:20 am

Sounds good to me.

Add a poll, I would vote for it.

(Thanks for your kind words to another end user of Macro Scheduler).
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Ernest
Newbie
Posts: 6
Joined: Thu Jan 09, 2003 8:29 pm

Post by Ernest » Sun Oct 31, 2004 9:17 am

Could GetFileList> be enhanced to let us choose our own delimiter?
A bit like this ...
StringSplit
--------------------------------------------------------------------------------

Separates a string into an array of substrings using the specified delimiters.

StringSplit, OutputArray, InputVar [, Delimiters, OmitChars, FutureUse]

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Added a Poll

Post by jpuziano » Wed Nov 03, 2004 7:33 am

Added a Poll per your suggestion Bob and used your suggested rankings:

5. Important, even if the size/efficiency increases/degrades
4. Somewhat important
3. I'm okay either way
2. Somewhat unimportant
1. Unimportant, even if the size/efficiency remains unaffected

Thanks again!
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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 » Wed Nov 03, 2004 8:00 am

Poll looks good.

Have you allowed for provisional votes?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sat Nov 06, 2004 12:21 am

I found this vbscript somewhere and adjusted it to work in MSChed. It's not as fast as GetFileList, but it does work, and it's flexible.

VBSTART

Function filelist (dirname)
Dim fso, f, f1, fc, s
Dim listcount

listcount = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set fold = fso.GetFolder(dirname)
Set fc = fold.Files
For Each f1 in fc
s = s & f1.name & ","
listcount = listcount + 1
Next
MsgBox("Found " & listcount & " items.")
filelist = s
End Function

VBEND

Rem> ****** Begin - Parts that can be edited

Let>MyDir=C:\My\Folder\

Rem> ****** End - Parts that can be edited

Rem>' Check that %MyDir% exists
IfDirExists>%MyDir%,DirExists
MessageModal>Directory does not exist;%CRLF%%MyDir%
Goto>TheEnd

Label>DirExists
VBEval>filelist("%MyDir%"),sList
Message>%sList%

Label>TheEnd


I hope it is of some use to someone, even if just as a vbscript example.

I have a similar one that can be used to obtain directory names only.

(Edit: Actually, it seems this one is VERY fast at getting the filenames and returning the list in to the var! 1000 items return in about 1/2 a second on my pc.)

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

Post by support » Fri Nov 19, 2004 11:35 am

The next release allows an optional delimiter to be used in GetFileList as suggested. Default is semi-colon. New syntax will be:

GetFileList>filespec,result[,delimiter]
MJT Net Support
[email protected]

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Nov 24, 2004 10:37 pm

Excellent, thank you Support.
Also, thanks Captive for the VBScript example.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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