Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete duplicate file names?
#2
Try this:

Macro Macro26
Code:
Copy      Help
out
Dir D_JPG
ARRAY(str) a
foreach(D_JPG "$desktop$\Data\Screenshot\*.jpg" FE_Dir)
,a[]=D_JPG.FullPath

foreach(D_JPG "$desktop$\Data\Screenshot\*.jpg" FE_Dir)
,str JPG_Path=D_JPG.FullPath
,str JPG_Name=D_JPG.FileName

,str GetTEST; int cc
,if(!findrx(JPG_Name "TEST=(.*?)\s" 0 2 GetTEST)) out "ERROR"; ret
,;out GetTEST
,;Check for duplicate filename
,int i found=0
,for i 0 a.len
,,if (find(a[i] GetTEST) != -1)
,,,;out "Found a match"
,,,if found
,,,,del a[i]
,,,,a.remove(i)
,,,,break
,,,else
,,,,found=1


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)