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. Searching for a sting in a CFile ?

Searching for a sting in a CFile ?

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

    Is there an easy way to search a CFile for a string and get the index?

    L H D 3 Replies Last reply
    0
    • U USAFHokie80

      Is there an easy way to search a CFile for a string and get the index?

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

      USAFHokie80 wrote:

      Is there an easy way to search a CFile

      No you have to search the file line by line

      USAFHokie80 wrote:

      get the index

      The index based on what?

      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns

      U 1 Reply Last reply
      0
      • L Lost User

        USAFHokie80 wrote:

        Is there an easy way to search a CFile

        No you have to search the file line by line

        USAFHokie80 wrote:

        get the index

        The index based on what?

        Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns

        U Offline
        U Offline
        USAFHokie80
        wrote on last edited by
        #3

        the index for a file position where the string begins.

        1 Reply Last reply
        0
        • U USAFHokie80

          Is there an easy way to search a CFile for a string and get the index?

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          ScanR - Text file string search and replace engine[^].

          1 Reply Last reply
          0
          • U USAFHokie80

            Is there an easy way to search a CFile for a string and get the index?

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

            Yes, assuming you put the contents of said file in a searchable buffer

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            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