Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Report of file names  (Read 3519 times)

0 Members and 1 Guest are viewing this topic.

st8ofid

    Topic Starter


    Newbie

    • Experience: Expert
    • OS: Windows 7
    Report of file names
    « 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. 

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Report of file names
    « Reply #1 on: April 22, 2014, 12:48:52 PM »
    How about showing an example of what you are trying to describe.

    st8ofid

      Topic Starter


      Newbie

      • Experience: Expert
      • OS: Windows 7
      Re: Report of file names
      « Reply #2 on: April 22, 2014, 02:50:26 PM »
      Here's a sample attachment.

      [recovering disk space, attachment deleted by admin]

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      Re: Report of file names
      « Reply #3 on: April 22, 2014, 03:48:27 PM »
      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

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: Report of file names
      « Reply #4 on: April 22, 2014, 11:06:15 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.

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      Re: Report of file names
      « Reply #5 on: April 22, 2014, 11:42:40 PM »
      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.

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: Report of file names
      « Reply #6 on: April 23, 2014, 01:37:45 AM »
      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.