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

Author Topic: Duplicate file Content  (Read 3193 times)

0 Members and 1 Guest are viewing this topic.

seeneedee

    Topic Starter


    Rookie

    Duplicate file Content
    « on: December 20, 2010, 11:31:25 PM »
    hi friend,

    How can we read the content of copied file and compare with the content of files in destination folder (where we are going to paste)?

    example:

    My purpose is to when we copy and paste multiple times of with  samefile name(e.g 1.txt) it is pasted as  copy of (1).txt,copy of (2).txt etc.

    The above scinerio for with the reference of file .The same thing should be done with reference of file content .If content is same the above process should happen.

    Spoiler



      Specialist

      Thanked: 50
    • Experience: Beginner
    • OS: Windows XP
    Re: Duplicate file Content
    « Reply #1 on: December 21, 2010, 08:02:49 AM »
    I am not sure what you are trying to do...Are you coping a file from one place to another keeping the same name at the new location? Or are you coping the file to a new location and changing the name and then checking to see if the files match?

    Also are these all text files?

    Whenever I watch TV and I see those poor starving kids all over the world, I can't help but cry. I mean I would love to be skinny like that, but not with all those flies and death and stuff." - Mariah Carey, Pop Singer

    Doc_Vibe



      Rookie

      Thanked: 4
      • Yes
    • Experience: Experienced
    • OS: Windows XP
    Re: Duplicate file Content
    « Reply #2 on: December 22, 2010, 12:31:55 PM »
    I think what he is trying to do is compare the CONTENTS of the file to see if they are the same. I believe he wants to make sure the contents are or not.  Now, there used to be an old DOS based Norton program (Norton Utilities) that would compare the contents of a file (where you could split the screen and see the same file name say from two different drives in each side of the split screen and Norton would high light the same or additional content of that same file name)  but WOW that was years ago since I've seen my copy even. My suggestion, since you can not compare the contents of the file in any Windows program that I know of, I would look at the file size and compare that to the file that you are trying to copy into the, I take it, the same folder. Hope I'm right in that assumption. If the file size is the exact same then, it would be prudent to assume that they have the same content. other than that... Your going to have to read the file manually and make the best guess as to weather they are the same or not.

    All the best with that

    God Bless

    Doc

    Let all things be done decently and in order - 1 Cor. 14:40

    Doc_Vibe



      Rookie

      Thanked: 4
      • Yes
    • Experience: Experienced
    • OS: Windows XP
    Re: Duplicate file Content
    « Reply #3 on: December 24, 2010, 03:02:31 PM »
    hi friend,

    How can we read the content of copied file and compare with the content of files in destination folder (where we are going to paste)?

    example:

    My purpose is to when we copy and paste multiple times of with  samefile name(e.g 1.txt) it is pasted as  copy of (1).txt,copy of (2).txt etc.

    The above scinerio for with the reference of file .The same thing should be done with reference of file content .If content is same the above process should happen.


    WinNC

    I believe I have found what you are looking for seeneedee. Took a couple of days, but I finally found a program simular to Norton Commander v5.51

    Here is a program that works the same way as the old DOS version of Norton Commander v5.51 way back in the old days, but this program works in Windows-x. It's called WinNC and It has the same capabilities to compare text files to one another. From different drives or different folders. Whatever you chose. It works off of the dual-pane principle. So you are able to see the comparison right there in front of you. It is a replacement file manager for  Windows Explorer, only a lot more powerful. Try it, I think you'll like it. If it helps you for what you need - Please post back and let me know.

    Here is the URL for the Download site. It is at Download.com just so you know you are at the proper site for download. It should be right at the top of the list under the heading of "203 software downloads results for "Norton Commander DOS"

    http://download.cnet.com/1770-20_4-0.html?query=Norton+Commander+DOS&platformSelect=Windows&tag=srch&searchtype=downloads&filterName=platform%3DWindows&filter=platform%3DWindows

    Just click the Download Now button to the right.


    Hope this helps

    God Bless

    Doc



    Let all things be done decently and in order - 1 Cor. 14:40

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Duplicate file Content
    « Reply #4 on: December 24, 2010, 03:17:19 PM »
    since you can not compare the contents of the file in any Windows program that I know of

    WinDiff

    Addins for Visual Studio, as well as the SDK (which is free and includes WinDiff). EditpadPro has a compare option, I think JGSoft even has a software product exclusively for comparing files... sort of. (PowerGREP)

    There isn't a shell extension that compares the contents of files and changes the name of the file if they are the same that I am aware of, though.

    in a batch file you can do something like this (Taken from  a google search)

    Code: [Select]
    FC file1.txt file2.txt | FIND "FC: no dif" > nul
    IF ERRORLEVEL 1 echo "files different"
    I was trying to dereference Null Pointers before it was cool.

    Doc_Vibe



      Rookie

      Thanked: 4
      • Yes
    • Experience: Experienced
    • OS: Windows XP
    Re: Duplicate file Content
    « Reply #5 on: December 24, 2010, 05:42:29 PM »
    I like your idea better BC_P. See, the more ya learn, the more you understand that you really don't know much at all. I should shut up now - lol

    Doc
    Let all things be done decently and in order - 1 Cor. 14:40