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. C#
  4. comparing ini files

comparing ini files

Scheduled Pinned Locked Moved C#
question
9 Posts 4 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.
  • U Offline
    U Offline
    User 589870
    wrote on last edited by
    #1

    hi, i have two ini files with same format and i have to compare them and if any change in new ini file then corporate the change in old one.hw to do that?

    E L A 3 Replies Last reply
    0
    • U User 589870

      hi, i have two ini files with same format and i have to compare them and if any change in new ini file then corporate the change in old one.hw to do that?

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      Why don't you just replace the old one with the new one? Cheers

      I don't like my signature at all

      U 1 Reply Last reply
      0
      • E Estys

        Why don't you just replace the old one with the new one? Cheers

        I don't like my signature at all

        U Offline
        U Offline
        User 589870
        wrote on last edited by
        #3

        no i have to jst look at keys in new ini and change respective values in old ini.I dnt want to replace.

        U E 2 Replies Last reply
        0
        • U User 589870

          hi, i have two ini files with same format and i have to compare them and if any change in new ini file then corporate the change in old one.hw to do that?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You can use "Notepad++", it has compare feature in it's Plugins menu. From here you can compare two file which are text based..(i.e. .txt, .doc, etc and also .ini) You can download it from following link, it's totally free http://notepad-plus.sourceforge.net/uk/download.php[^] Hope this will help!

          Jinal Desai - LIVE Experience is mother of sage....

          U 1 Reply Last reply
          0
          • U User 589870

            no i have to jst look at keys in new ini and change respective values in old ini.I dnt want to replace.

            U Offline
            U Offline
            User 589870
            wrote on last edited by
            #5

            reason for not using replace method is i have to skip some specific keys and change others.

            1 Reply Last reply
            0
            • L Lost User

              You can use "Notepad++", it has compare feature in it's Plugins menu. From here you can compare two file which are text based..(i.e. .txt, .doc, etc and also .ini) You can download it from following link, it's totally free http://notepad-plus.sourceforge.net/uk/download.php[^] Hope this will help!

              Jinal Desai - LIVE Experience is mother of sage....

              U Offline
              U Offline
              User 589870
              wrote on last edited by
              #6

              i have to do it programatically.

              L 1 Reply Last reply
              0
              • U User 589870

                no i have to jst look at keys in new ini and change respective values in old ini.I dnt want to replace.

                E Offline
                E Offline
                Estys
                wrote on last edited by
                #7

                More info here : http://www.codeproject.com/KB/cs/cs_ini.aspx[^] Cheers

                I don't like my signature at all

                1 Reply Last reply
                0
                • U User 589870

                  i have to do it programatically.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Then you can load both files in string using streamreader and then you can compare by using equal function of it.

                  Jinal Desai - LIVE Experience is mother of sage....

                  1 Reply Last reply
                  0
                  • U User 589870

                    hi, i have two ini files with same format and i have to compare them and if any change in new ini file then corporate the change in old one.hw to do that?

                    A Offline
                    A Offline
                    Abhinav S
                    wrote on last edited by
                    #9

                    Comparing two text files can be tricky business and may need some complex algorithms. If you just have a few keys in your file, then it might just be faster for you to load both files in a dictionary and then compare the values.

                    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