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. String Parsing

String Parsing

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
5 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
    KKR
    wrote on last edited by
    #1

    I need to open a Text file and read the first line which is like "Run","FileNo","Distance",... Then i've pickup words like Run,FileNo. I was able to open, read Line using CStdioFile.ReadLine(); How to parse the line and get the words?? Thanks In advance. Warm Regards, KKR

    V 1 Reply Last reply
    0
    • K KKR

      I need to open a Text file and read the first line which is like "Run","FileNo","Distance",... Then i've pickup words like Run,FileNo. I was able to open, read Line using CStdioFile.ReadLine(); How to parse the line and get the words?? Thanks In advance. Warm Regards, KKR

      V Offline
      V Offline
      Vitali Halershtein
      wrote on last edited by
      #2

      Hi, From many other ways you can try standard C functions like strtock(...) Vitali http://www.creative-case.com[^]

      K 1 Reply Last reply
      0
      • V Vitali Halershtein

        Hi, From many other ways you can try standard C functions like strtock(...) Vitali http://www.creative-case.com[^]

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

        Thanks for Flashy Response, Now My entire line is in a CString , shall i have to convert it to char* , to apply those functions like strtock(); Warm Regards, KKR

        V 1 Reply Last reply
        0
        • K KKR

          Thanks for Flashy Response, Now My entire line is in a CString , shall i have to convert it to char* , to apply those functions like strtock(); Warm Regards, KKR

          V Offline
          V Offline
          Vitali Halershtein
          wrote on last edited by
          #4

          this is very simple: use syntax similar: strtok( (char*)(LPCTSTR)CStringvariable, ... ); or use GetBuffer member from CString Vitali http://www.creative-case.com[^]

          K 1 Reply Last reply
          0
          • V Vitali Halershtein

            this is very simple: use syntax similar: strtok( (char*)(LPCTSTR)CStringvariable, ... ); or use GetBuffer member from CString Vitali http://www.creative-case.com[^]

            K Offline
            K Offline
            KKR
            wrote on last edited by
            #5

            Thanks Mr Vitali, I got the result. Warm Regards, KKR

            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