AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

loop FilePattern help !

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Zachari
Guest





PostPosted: Mon Jun 08, 2009 9:50 am    Post subject: loop FilePattern help ! Reply with quote

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

PostPosted: Mon Jun 08, 2009 10:15 am    Post subject: Reply with quote

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
View user's profile Send private message
pajenn



Joined: 07 Feb 2009
Posts: 384

PostPosted: Mon Jun 08, 2009 10:19 am    Post subject: Reply with quote

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
View user's profile Send private message
JDN



Joined: 24 Mar 2004
Posts: 299

PostPosted: Mon Jun 08, 2009 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
pajenn



Joined: 07 Feb 2009
Posts: 384

PostPosted: Mon Jun 08, 2009 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Zachari
Guest





PostPosted: Mon Jun 08, 2009 12:46 pm    Post subject: Reply with quote

Fanuc CNC Machines create files without ext... this guys know how stuff works... Sad

thanks, for your response !
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group