AutoHotkey Community

It is currently May 26th, 2012, 6:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: loop FilePattern help !
PostPosted: June 8th, 2009, 10:50 am 
Hello,


Im' looking for pattern for a loop. But the pattern must match only files without extention. is this possible?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 11:15 am 
Offline

Joined: March 24th, 2004, 2:34 pm
Posts: 299
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 June 8th, 2009, 11:25 am, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 11:19 am 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
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 June 8th, 2009, 11:22 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 11:22 am 
Offline

Joined: March 24th, 2004, 2:34 pm
Posts: 299
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
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 12:03 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 1:46 pm 
Fanuc CNC Machines create files without ext... this guys know how stuff works... :(

thanks, for your response !


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn, SKAN and 57 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group