# Compare Directories with only partial names/pattern matching (Files converting)

**URL:** <https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686>\
**Category:** Help & Support\
**Created:** [May 6, 2024, 3:46am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686 "2024-05-06T03:46:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacc190676](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/85f322/32.png) [@jacc190676](https://resource.dopus.com/u/jacc190676)\
**Post date:** [May 6, 2024, 3:46am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/1 "2024-05-06T03:46:41Z")

</div>

Hi

I use different tools to convert files. Sometimes these tools end up with errors or crash, or maybe overjump some single files because errors. Some conversions need mutch time, maybe they crash, so just starting new isn't really an option.

I would like to use a compare in 2 Listers (source/dest) witch shows me what have been done and what needs a second try.

Examples:

file1.JPG gets converted to file1.PNG  
file2.DWG gets converted to file2.SVG  
or  
file3.jpg gets converted to file3XYZ.jpg  
file4.gif gets converted to file4XYZ.psd

now i need a type of "variable FILENAME compare" where i can define patterns what FOR ME means "SAME" even Names are different.  
eg. if file1.JPG + file2.JPG exist left side and file1.PNG + file2.PNG right side then it is "synchronous" (convert job done, all fine)

or

if file3.jpg + file4.jpg exists left side and file3XYZ.jpg + file4XYZ.jpg exists right side  
then the listers are "synchronous"

Has anyone an idea how i can do this?

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [May 6, 2024, 5:36am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/2 "2024-05-06T05:36:19Z")

</div>

You could use **Select** to find all files that have proper matches and display the ones that do not, e.g.:

```plaintext
Select NONE
Select DESTTOSOURCE=in,noext
Select FILTERDEF =Exists({destpath} + Stem(file_name) + "XYZ" + FileExt(file_name))
Select INVERT SETFOCUS
Select SHOWFOCUS

```

[How to use buttons and scripts from this forum](https://resource.dopus.com/t/how-to-use-buttons-and-scripts-from-this-forum/3546)

---

<div class="post-metadata">

**Author:** ![jacc190676](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/85f322/32.png) [@jacc190676](https://resource.dopus.com/u/jacc190676)\
**Post date:** [May 14, 2024, 10:26pm UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/3 "2024-05-14T22:26:18Z")

</div>

Thank you for your answer.

if i make a button and try that, the script-handler does "something", but ends in an error  
also not selecting something useful. (Error in line 1 position 8)  
I tried to set on/off evaluation mode but not changed something.  
Do you maybe have an aditional hint?

15.05.24 17:18 Evaluator: Fehler in Zeile 1, Position 8  
Unbekannter Wert (6): B  
Exists(B:\_BACKUPS\ + Stem(file\_name) + "XYZ" + FileExt(file\_name))

---

<div class="post-metadata">

**Author:** ![jinsight](https://resource.dopus.com/user_avatar/resource.dopus.com/jinsight/32/43666_2.png) [@jinsight](https://resource.dopus.com/u/jinsight)\
**Post date:** [May 15, 2024, 12:27am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/4 "2024-05-15T00:27:46Z")

</div>

How about something like this:

[Unique Files in Each Pane Toggle.dcf](https://resource.dopus.com/uploads/short-url/mqNm6ZsG1qBReDa731W2oxckd5y.dcf) (930 Bytes)

---

<div class="post-metadata">

**Author:** ![fkast](https://resource.dopus.com/user_avatar/resource.dopus.com/fkast/32/26108_2.png) [@fkast](https://resource.dopus.com/u/fkast)\
**Post date:** [May 15, 2024, 3:17am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/5 "2024-05-15T03:17:49Z")

</div>

there's a similar script, "hide itentical names":

```auto
function OnClick(clickData)
{
	var cmdSource = clickData.func.command;
	cmdSource.ClearFiles();

	var cmdDest = DOpus.create.command;
	cmdDest.SetSourceTab(clickData.func.desttab);

	cmdSource.RunCommand("Select DESELECTNOMATCH SOURCETODEST=in");
	cmdDest.RunCommand("Select DESELECTNOMATCH SOURCETODEST=in");
	cmdSource.RunCommand("Select NOPATTERN HIDESEL");
	cmdDest.RunCommand("Select NOPATTERN HIDESEL");
}

```

and second for restore:

```auto
function OnClick(clickData)
{
	var cmdSource = clickData.func.command;
	cmdSource.ClearFiles();

	var cmdDest = DOpus.create.command;
	cmdDest.SetSourceTab(clickData.func.desttab);

	cmdSource.RunCommand("Select NOPATTERN SHOWHIDDEN");
	cmdDest.RunCommand("Select NOPATTERN SHOWHIDDEN");
}

```

P.S.  
and of course there's an old CompareTabs

> [@Compare tab contents in dual display mode](https://resource.dopus.com/t/compare-tab-contents-in-dual-display-mode/17344):
>
> Here's a simple script for comparing tab contents in dual display mode. This script compares the files in source and destination tabs and selects the files that do no exist in other tab or differ by size. By default only file names are compared and…

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [May 15, 2024, 9:36am UTC](https://resource.dopus.com/t/compare-directories-with-only-partial-names-pattern-matching-files-converting/50686/6 "2024-05-15T09:36:03Z")

</div>

> [@jacc190676](#):
>
> Do you maybe have an aditional hint?

Difficult to say... the button worked fine here with your sample files.
