Compare doc files

Forum Forums New users New Users and General Questions Compare doc files

  • This topic has 12 replies, 6 voices, and was last updated Apr 23-7:14 am by andfree.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #105129
    Member
    andfree

      Hi. Is there any way to compare two doc files (or two versions of the same file) and find the differences? Thanks.

      #105130
      Member
      Lead Farmer
        #105135
        Member
        RJP
          Helpful
          Up
          1
          ::

          Install meld and compare using graphical application.

          sudo apt install meld

          https://opensource.com/article/20/3/meld

          #105137
          Member
          Robin
            Helpful
            Up
            1
            ::

            Since this question is about „doc”-files, which is not a plain .txt file you could compare directly, you won’t get useful results with meld. You have two options:

            A.) Open the documents with Libreoffice. Save them as simple .txt files. Then you can compare them easily with meld, as suggested by RJP.

            B.) Open the second document with Libreoffice.
            – From Edit menu select „Differences/Changes” → „Compare Document…”.
            – In the dialog box select the original document and click „Open”.

            The Libreoffice Writer should find and highlight all differences between the documents and show another dialogbox for accept or reject the changes one by one, while walking through the text.

            Windows is like a submarine. Open a window and serious problems will start.

            #105145
            Member
            techore
              Helpful
              Up
              1
              ::

              Both rjp and Robin’s recommendation are excellent.

              If going with Robin’s suggestion A and the file is large and has a lot of formatting, you may want to consider exporting to .rtf or richtext versus text. It a decision point for you. Using richtext will retain much of the formatting codes and you can directly edit the file in meld, save, load the updated file into Libreoffice, and save as .doc.

              #105194
              Member
              andfree
                Helpful
                Up
                0
                ::

                Many thanks for all the replies.

                Open the second document with Libreoffice.
                – From Edit menu select „Differences/Changes” → „Compare Document…”.

                I see „Differences/Changes” or „Compare Document…” nowhere in the Edit or other menu of the Libreoffice (version 7.4.5.1).

                $ diff list.docx list2.docx
                Binary files list.docx and list2.docx differ
                $ cmp list.docx list2.docx
                list.docx list2.docx differ: byte 11, line 1

                If this means there’s a difference in the 11th character (including spaces) of the 1st line, I don’t see it.

                $ tput list.doc list2.doc
                tput: unknown terminfo capability 'list.doc'

                $ meld list.txt list2.txt
                $ meld list.rtf list2.rtf
                The output for both of them is: “Files are identical”.

                • This reply was modified 2 weeks, 3 days ago by andfree.
                • This reply was modified 2 weeks, 3 days ago by andfree.
                #105205
                Member
                Lead Farmer
                  Helpful
                  Up
                  1
                  ::

                  If this means there’s a difference in the 11th character (including spaces) of the 1st line, I don’t see it.

                  The diff and cmp commands don’t work with docx files. I test it and I got the same thing.
                  If the files are plain text, you can try save as .txt files, and use the diff and cmp command.

                  #105206
                  Member
                  andfree
                    Helpful
                    Up
                    0
                    ::

                    If the files are plain text, you can try save as .txt files, and use the diff and cmp command.

                    Thanks, but, as I wrote above, if I save them as .txt or .rtf, then the two files are identical:

                    $ diff list.txt list2.txt
                    $ cmp list.txt list2.txt

                    No difference found.

                    • This reply was modified 2 weeks, 3 days ago by andfree.
                    • This reply was modified 2 weeks, 3 days ago by andfree.
                    #105226
                    Member
                    techore
                      Helpful
                      Up
                      0
                      ::

                      The output for both of them is: “Files are identical”.

                      Execute meld as a gui app and inspect the files. Meld permits intuitive visual inspection and editing. Based on the output you provided, it looks as if you ran it as a cli command. If the results are a concern, then inspect using the GUI.

                      Make sure to close any other apps like libreoffice if you have the files open with them to avoid confusion and possibly locking files.

                      #105227
                      Member
                      Xunzi_23
                        Helpful
                        Up
                        1
                        ::

                        Compare is built in to LO Writer.

                        Open the newest version in Writer then EDIT > TRACK CHANGES > COMPARE DOCUMENT then select the older document.

                        See HELP > DOCUMENTS COMPARING for more information

                        Compare is built in to LO Writer.

                        #105263
                        Member
                        andfree
                          Helpful
                          Up
                          0
                          ::

                          Execute meld as a gui app and inspect the files. Meld permits intuitive visual inspection and editing. Based on the output you provided, it looks as if you ran it as a cli command. If the results are a concern, then inspect using the GUI.

                          Sorry that I didn’t make it clear. As “output”, I meant the result as appear in the GUI, not a terminal output. If I first open the GUI and afterwards select the files, this makes no difference to the result: “Files are identical”, again.

                          EDIT > TRACK CHANGES > COMPARE DOCUMENT

                          Many thanks, “Compare Document” is there. I tested it with two random files and it works. But it doesn’t find any difference between the list.docx & the list2.docx files.

                          See HELP > DOCUMENTS COMPARING for more information

                          Unfortunately, I don’t see any “Compare Document” entry in the “Help” menu.

                          • This reply was modified 2 weeks, 2 days ago by andfree.
                          #105273
                          Member
                          Xunzi_23
                            Helpful
                            Up
                            1
                            ::

                            Hi andfree, I have no local help installed and running LO 7.5.2,
                            would start with below, if neccesary changing version number.
                            I think proceedure is same for most LO versions.

                            Should known differences not be detected be good to post a report to LO Org.

                            https://help.libreoffice.org/6.4/en-US/text/shared/guide/redlining_doccompare.html?DbPAR=SHARED

                            #105274
                            Member
                            andfree
                              Helpful
                              Up
                              0
                              ::

                              Should known differences not be detected be good to post a report to LO Org.

                              Hi. After all, I’m convinced that there’s no difference as regards the content of the two files. I think there’s no reason to waste more of our time. Thanks again.

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • You must be logged in to reply to this topic.