 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
scriptmonkey
Joined: 19 May 2006 Posts: 112
|
Posted: Fri Nov 16, 2007 8:06 am Post subject: Need to read a dir and sub dir for all .jpg |
|
|
I am trying to find duplicate files in a number of folders. What I need to do choose a directory, then the script goes thru the dir and sub dirs and find all .jpg files. The path, filename, and modification date/time (the date/time the picture was taken) will be exported to a text file.
I know how to read a file for the modification date, but how can I go thru a dir and sub dirs to search for only .jpg files? _________________ Zak M. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Fri Nov 16, 2007 9:06 am Post subject: |
|
|
if you want find duplicate can sort it by filename and modifications date
| Code: | AA=c:\test
F1=savedfilenames.txt
F2=sortedfiles.txt
ifexist,%F1%
filedelete,%F1%
ifexist,%F2%
filedelete,%F2%
I=0
Loop %AA%\*.jpg,,1
{
LFP=%A_LoopFileLongPath%
LFN=%A_LoopFilename%
LFM=%A_loopfiletimemodified%
fileappend,%LFN%;%LFM%;%LFP%`r`n,%F1%
I++
}
FileRead,AB,%F1%
Sort,AB
FileAppend,%AB%,%F2%
run,%F2%
exitapp
|
|
|
| Back to top |
|
 |
scriptmonkey
Joined: 19 May 2006 Posts: 112
|
Posted: Fri Nov 16, 2007 2:57 pm Post subject: |
|
|
Thanks. This should work fine. I can rename the txt file to CSV and pop it into Excel.
Question though, how can I replace the semicolons with commas?
fileappend,%LFN%;%LFM%;%LFP%`r`n,%F1%
CHANGE TO
fileappend,%LFN%,%LFM%,%LFP%`r`n,%F1%
I tried putting them in quotes, but it didn't work. _________________ Zak M. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Fri Nov 16, 2007 3:07 pm Post subject: |
|
|
need escape character also for `% (if you have one procent sign, not in this case )
example `r`n is for carrige return and linefeed
fileappend,what1`,what2`r`n,where
| Code: | | fileappend,%LFN%`,%LFM%`,%LFP%`r`n,%F1% |
|
|
| 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
|