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. File I/O inside a text file

File I/O inside a text file

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
5 Posts 3 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Sorry for the newbie question, but lets say i have a text file, and in a certain location in the text file, there is a string of characters I would like to modify.. lets say its HIGHSPEED.. if I want to replace HIGHSPEED with DIALUP, without having excess whitespaces, how would I accomplish that? I want to remove the extra spaces that would be at the end if I were to seek the offset, and replace the word with my secondary word. Thanks in advance. btw. I can do this in MFC or C style. MFC prefered (bleh)

    T D 2 Replies Last reply
    0
    • A Anonymous

      Sorry for the newbie question, but lets say i have a text file, and in a certain location in the text file, there is a string of characters I would like to modify.. lets say its HIGHSPEED.. if I want to replace HIGHSPEED with DIALUP, without having excess whitespaces, how would I accomplish that? I want to remove the extra spaces that would be at the end if I were to seek the offset, and replace the word with my secondary word. Thanks in advance. btw. I can do this in MFC or C style. MFC prefered (bleh)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Is the file very large? If not, you could load it into memory, perform string replace and write back. Tomasz Sowinski -- http://www.shooltz.com

      What is "scratch" and why can everything be made from it?

      D 1 Reply Last reply
      0
      • A Anonymous

        Sorry for the newbie question, but lets say i have a text file, and in a certain location in the text file, there is a string of characters I would like to modify.. lets say its HIGHSPEED.. if I want to replace HIGHSPEED with DIALUP, without having excess whitespaces, how would I accomplish that? I want to remove the extra spaces that would be at the end if I were to seek the offset, and replace the word with my secondary word. Thanks in advance. btw. I can do this in MFC or C style. MFC prefered (bleh)

        D Offline
        D Offline
        dlhson
        wrote on last edited by
        #3

        replace HIGHSPEED with DIALUP You must handle that. Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

        1 Reply Last reply
        0
        • T Tomasz Sowinski

          Is the file very large? If not, you could load it into memory, perform string replace and write back. Tomasz Sowinski -- http://www.shooltz.com

          What is "scratch" and why can everything be made from it?

          D Offline
          D Offline
          dlhson
          wrote on last edited by
          #4

          Even if it's so large, you can use String tech with FileMapping :rolleyes: Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

          T 1 Reply Last reply
          0
          • D dlhson

            Even if it's so large, you can use String tech with FileMapping :rolleyes: Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            How do you grow or shrink memory mapped file? Tomasz Sowinski -- http://www.shooltz.com

            What is "scratch" and why can everything be made from it?

            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