 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Zachari Guest
|
Posted: Mon Jun 08, 2009 9:50 am Post subject: loop FilePattern help ! |
|
|
Hello,
Im' looking for pattern for a loop. But the pattern must match only files without extention. is this possible? |
|
| Back to top |
|
 |
JDN
Joined: 24 Mar 2004 Posts: 299
|
Posted: Mon Jun 08, 2009 10:15 am Post subject: |
|
|
Here is an example from the Help file that I have modified slightly. try this: I tested it and it accesses all files that have no extension.
| Code: |
Loop, %A_ProgramFiles%\*., , 1 ; Recurse into subfolders.
{
MsgBox, 4, , Filename = %A_LoopFileFullPath%`n`nContinue?
IfMsgBox, No
break
}
|
Last edited by JDN on Mon Jun 08, 2009 10:25 am; edited 5 times in total |
|
| Back to top |
|
 |
pajenn
Joined: 07 Feb 2009 Posts: 384
|
Posted: Mon Jun 08, 2009 10:19 am Post subject: |
|
|
yes, just use something like this (not tested):
| Code: |
Loop, C:\*.*,0,1
{
if A_LoopFileExt <>
continue
else msgbox %A_LoopFileName% file has no extension
}
return |
_________________ Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler.
Last edited by pajenn on Mon Jun 08, 2009 10:22 am; edited 1 time in total |
|
| Back to top |
|
 |
JDN
Joined: 24 Mar 2004 Posts: 299
|
Posted: Mon Jun 08, 2009 10:22 am Post subject: |
|
|
pajenn,
I believe that using "*.*" will get you all file names including those with extensions.
I tried the following code and it accessed all files in my C folder - both with and without extensions:
| Code: |
Loop, C:\*.*, , 1 ; Recurse into subfolders.
{
MsgBox, 4, , Filename = %A_LoopFileFullPath%`n`nContinue?
IfMsgBox, No
break
}
|
|
|
| Back to top |
|
 |
pajenn
Joined: 07 Feb 2009 Posts: 384
|
Posted: Mon Jun 08, 2009 11:03 am Post subject: |
|
|
| JDN wrote: | pajenn,
I believe that using "*.*" will get you all file names including those with extensions.
I tried the following code and it accessed all files in my C folder - both with and without extensions:
| Code: |
Loop, C:\*.*, , 1 ; Recurse into subfolders.
{
MsgBox, 4, , Filename = %A_LoopFileFullPath%`n`nContinue?
IfMsgBox, No
break
}
|
|
i know, which is why i included the the "if A_LoopFileExt <>// continue" to skip those with extensions. however, the solution of looping only C:\*. is of course simpler and better - i just hadn't thought of it or seen it before posting... _________________ Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler. |
|
| Back to top |
|
 |
Zachari Guest
|
Posted: Mon Jun 08, 2009 12:46 pm Post subject: |
|
|
Fanuc CNC Machines create files without ext... this guys know how stuff works...
thanks, for your response ! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|