Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing do files

    This seems like a pretty straightforward option in code editing\writing, but I wasn't able to find how to do it. searching did not yield any meaningful results as well.
    I have 2 do files which I suspect are pretty much identical. I wish to compare them - how do i do that? other than just looking at the codes manually obviously...

  • #2
    There are multiple tools that you can use for that. Which tool you should use depends on your operating system. If you google

    comparing text files in windows

    The first couple of links will provide you tools for doing what you want.

    Comment


    • #3
      As Mikko said, it depends on your operating system. Here are two options I use to compare text files with different text editors:

      Windows only: Compare plugin for Notepad++

      Windows/OS X/Linux: FileDiffs package for Sublime Text

      Comment


      • #4
        I was curious if anyone had written a Stata program to compare two text files, and sure enough, there is such a thing: Santiago Garriga's -tex_equal-. Type findit tex_equal..
        Stata/MP 14.1 (64-bit x86-64)
        Revision 19 May 2016
        Win 8.1

        Comment


        • #5
          If you're working on Windoze, an installation of Cygwin can help (e.g., give you all the niceties that exist in the land of *nix). If you're working on any type of *nix based system you can shell out and use the diff command. If you have the files stored in a git repository you can also use git diff to show the changes across two commits.

          Comment


          • #6
            As Carole J Wilson notes, Santiago Garriga's -tex_equal- is very slick, But . . . the files you are comparing should be in the same directory and you should be in that directory when you call the program. Otherwise, you will get the message that "File 1 does not exist".

            Comment


            • #7
              http://winmerge.org/?lang=en

              Comment


              • #8
                Hua Peng (StataCorp)
                That seems like a pretty cool tool.

                Comment

                Working...
                X