Get list of files

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Get list of files

Post by PepsiHog » Sat Dec 19, 2020 4:13 pm

Greetings,
I have been trying to get a list of files on my desktop. I move scripts that I am currently working on, onto my desktop. So I get these files on my desktop, .000 and .fol.

I have been trying to write a RegEx to get only files with an extension containing only numbers. Sounds so simple, right? Not sooooooo far! RegEx keeps giving me all files on my desktop.

My m.o. has been.....
GetFileList>........,Files
RegEx>........

If I only use \.\d\d\d then it will show the extensions. But I need the names so I can move the file(s).

Please help me before I buy a gun and shoot my computer (Yeah, it's like that.).

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: Get list of files

Post by hagchr » Sat Dec 19, 2020 5:29 pm

Hello, If you use ; as delimiter then maybe sth like this:

Code: Select all

GetFileList>C:\Users\Christer\Desktop\*.*,strFileList,;
Let>tmp0=[^;]+\.\d\d\d
RegEx>tmp0,strFileList,0,m,nm,0
i.e. look for non-delimit characters [^;]+ that end w . and three digits.

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: Get list of files

Post by PepsiHog » Sat Dec 19, 2020 6:25 pm

@hagchr,
Very cool! Thanks a bunch. I have no clue what you did here. Never heard of it. I love it. I will have to study it and increase my knowledge of RegEx.

Thanks,
PepsiHog

[edit] - Ok. In my help it's called or explained as "one character except" Will keep this in mind. Thanks again.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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