1.

Solve : Report of file names?

Answer»

I'm looking for the command to list files in a file structure with sub folders that will not show duplicate names.
What I have USED in the past is:  dir *.* /s ---but this will give me all dups.  How about showing an example of what you are trying to describe.Here's a sample attachment.

[recovering disk space, attachment deleted by admin]You know it is possible to COPY and paste from the CMD prompt.
Code: [Select]C:\Batch>dir /a-d /b /s *.txt
C:\Batch\temp\2.txt
C:\Batch\temp\3.txt
C:\Batch\temp\4.txt
C:\Batch\temp2\2.txt
C:\Batch\temp2\3.txt Quote from: st8ofid on April 22, 2014, 12:20:07 PM

I'm looking for the command to list files in a file structure with sub folders that will not show duplicate names.
What I have used in the past is:  dir *.* /s ---but this will give me all dups.

There is no single command to remove the duplicates.  You'll have to write code to do that.I THINK this would be very difficult to do without using temporary files to store the list of files in.  You could basically have to keep checking if the file NAME is found in the temporary file and if it isn't then add it to the temporary file. Quote from: Squashman on April 22, 2014, 11:42:40 PM
You basically have to keep checking if the file name is found in the temporary file and if it isn't then add it to the temporary file.

That's an effective method, though will be slower for thousands of files due to the file reading.  The OP will have to say if speed is a necessary FACTOR.


Discussion

No Comment Found