Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Comparing two large files

Comparing two large files

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klazen
    wrote on last edited by
    #1

    Hello, I am working on a function that displays the differences in two files. However, this can take minutes when the files are 1 MB or greater. is there a quick way to compare two files on a byte to byte basis and return the offset of the differing bytes and the bytes located there? Thanks.

    D 1 Reply Last reply
    0
    • K Klazen

      Hello, I am working on a function that displays the differences in two files. However, this can take minutes when the files are 1 MB or greater. is there a quick way to compare two files on a byte to byte basis and return the offset of the differing bytes and the bytes located there? Thanks.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There's nothing that will do it for you, if that's what you're asking. I'd probably start by reading a good size block of each file into its own buffer, then compare what's in the buffers. Reading one byte at a time from each file and comparing will probably be the slowest way you can do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      K 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There's nothing that will do it for you, if that's what you're asking. I'd probably start by reading a good size block of each file into its own buffer, then compare what's in the buffers. Reading one byte at a time from each file and comparing will probably be the slowest way you can do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        K Offline
        K Offline
        Klazen
        wrote on last edited by
        #3

        I was afraid to hear that. Sadly, that is how I am currently doing it. Thanks for the reply.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups