misc: powershell compare-object to compare text files...

i guess i'm hooked because here i am again writing about this stuff. anyway, this was just too cool to pass up. using one line, you can compare two text files: compare-object $(get-content file1.txt) $(get-content file2.txt) didn't say the stuff was complicated. :)

Comments

  1. I am trying to compare two files with about 20,00 entries each and it doesnt seem to work. If I compare them in Access, I get 1700 differences. When I compare with Powershell, about 20,00 differences.

    Is there a limit to the amount of data that can be compared?

    ReplyDelete
  2. There does appear to be a default limit. Check out: http://dmitrysotnikov.wordpress.com/2008/06/06/compare-object-gotcha/

    He writes about how to get around the limitation.

    ReplyDelete
  3. you know, i had JUST read that same article earlier this week and meant to go make a comment. thanks garth!

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment