Compare a text file containing file names with files in a folder

  1. Bowlsys's Avatar
    Posts : 49
    windows 10
       #1

    Compare a text file containing file names with files in a folder


    Hi,
    I have a text files containing a list of file names and I wish to compare that to a folder with files in it.
    The folder contains a rather large number of files and I want to see if files in that folder exist in the file with the list of file names.

    Hope I have explained my problem clearly.

    Would appreciate any help
    Thanks
      My Computer

  2. dalchina's Avatar
    Posts : 31,762
    Win 10 Pro (1903)
       #2

    Hi, can only think you'd need to create a simple script.

    First create a file containing a textual representation of just the file names in the folder.
    (That's one line using a DIR command, for example).

    Then use e.g.
    https://www.diffchecker.com/

    Just an idea..

    There are many option for comparing text files:
    How To Compare Two Text Files Using Notepad++
    Text Compare! - An online diff tool that can find the difference between two texts
    WinMerge - You will see the difference…


    That might work if the two files contain ordered lists, one item per line.

    If the files are for some reason radically different in format and layout, you would need to create your own search and compare script.
      My Computers

  3. Bowlsys's Avatar
    Posts : 49
    windows 10
    Thread Starter
       #3

    Hi Dalchina,

    Many thanks for your help.
    I am much nearer now, I have 2 text files containing the files in each directory, however one is not in alphabetical order.
    ave used the command line Sort command but the output duplicates each line.
    Until I can resolve this all the compare apps fail.

    Many Thanks
      My Computer

  4. dalchina's Avatar
    Posts : 31,762
    Win 10 Pro (1903)
       #4

    Hi, regarding the DIR command, if it's that one that needs sorting,
    DIR <source> /O /B > <output file>
    sorts appropriately

    For an existing text file e.g.
    Sort a list alphabetically - Office Support
    Sort Lines Alphabetically
    Last edited by dalchina; 29 Jan 2019 at 00:14.
      My Computers

  5. Bowlsys's Avatar
    Posts : 49
    windows 10
    Thread Starter
       #5

    Hi Dalchina,

    Thanks again,

    Solved my sort problem, got rid of the duplicates.
    Now have 2 alphabetically sorted text files which I compared using Notepad++

    This gave me the info I needed.

    Regards
      My Computer

  6. dalchina's Avatar
    Posts : 31,762
    Win 10 Pro (1903)
       #6

      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:47.
Find Us




Windows 10 Forums