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 / C++ / MFC
  4. Reading from a txt file

Reading from a txt file

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
10 Posts 7 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.
  • V Offline
    V Offline
    V K 2
    wrote on last edited by
    #1

    Hi, I have the only entry in the text file [Info] AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

    K F C M 4 Replies Last reply
    0
    • V V K 2

      Hi, I have the only entry in the text file [Info] AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

      K Offline
      K Offline
      kapardhi
      wrote on last edited by
      #2

      You can do the following : 1. Extract the entire row and then extract text starting from '=' or 2. i do not remember the functionality of the following functions exactly but i think you can use GetPrivateProfileSectionNames () or GetPrivateProfileString ()

      1 Reply Last reply
      0
      • V V K 2

        Hi, I have the only entry in the text file [Info] AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

        F Offline
        F Offline
        Fatbuddha 1
        wrote on last edited by
        #3

        Or use a regex package. Which language by the way.

        You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)

        1 Reply Last reply
        0
        • V V K 2

          Hi, I have the only entry in the text file [Info] AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

          C Offline
          C Offline
          Chandrasekharan P
          wrote on last edited by
          #4

          This will help you http://msdn.microsoft.com/en-us/library/4c0xfcce(VS.80).aspx[^]

          1 Reply Last reply
          0
          • V V K 2

            Hi, I have the only entry in the text file [Info] AppID=12c5cad4-3f6c-46f9-8ba7-61253cb23bec How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

            M Offline
            M Offline
            Madhu Nair 0
            wrote on last edited by
            #5

            VKupunaram wrote:

            How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

            As said by kapardhi Just try these two lines :)

            TCHAR szOut[MAX_PATH];
            DWORD dwReturn = ::GetPrivateProfileString(_T("Info"),_T("AppID"),_T("FAILED"),szOut,MAX_PATH,_T("C:\\yourfile.txt"))

            You will get "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" in szOut

            V 1 Reply Last reply
            0
            • M Madhu Nair 0

              VKupunaram wrote:

              How to retrieve "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" entry

              As said by kapardhi Just try these two lines :)

              TCHAR szOut[MAX_PATH];
              DWORD dwReturn = ::GetPrivateProfileString(_T("Info"),_T("AppID"),_T("FAILED"),szOut,MAX_PATH,_T("C:\\yourfile.txt"))

              You will get "12c5cad4-3f6c-46f9-8ba7-61253cb23bec" in szOut

              V Offline
              V Offline
              V K 2
              wrote on last edited by
              #6

              thanks.. this worked

              T 1 Reply Last reply
              0
              • V V K 2

                thanks.. this worked

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                so, you voted every answer you got as Bad because you couldn't figure how to read the documentation by yourself ? The "said working" solution is what someone else suggested without providing code... Dude, help yourself, and learn reading the MSDN :zzz: And if you're about to vote for this post, take time at least to explain why you do so

                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                D 1 Reply Last reply
                0
                • T toxcct

                  so, you voted every answer you got as Bad because you couldn't figure how to read the documentation by yourself ? The "said working" solution is what someone else suggested without providing code... Dude, help yourself, and learn reading the MSDN :zzz: And if you're about to vote for this post, take time at least to explain why you do so

                  [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  toxcct wrote:

                  so, you voted every answer you got as Bad...

                  Are you sure it was the OP?

                  "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  T M 2 Replies Last reply
                  0
                  • D David Crow

                    toxcct wrote:

                    so, you voted every answer you got as Bad...

                    Are you sure it was the OP?

                    "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #9

                    not that much, but at least, he could defend himself ?! lol

                    [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                    1 Reply Last reply
                    0
                    • D David Crow

                      toxcct wrote:

                      so, you voted every answer you got as Bad...

                      Are you sure it was the OP?

                      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      M Offline
                      M Offline
                      Madhu Nair 0
                      wrote on last edited by
                      #10

                      :-\ Stopped voting ! I missed a 5 :^) :laugh: just kidding.

                      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