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. How to Split a txt file.

How to Split a txt file.

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

    Hi Friends, I have a MHTML file, i have to Split it in to Number of files, First from the Header of the file as header. Then we have a String in as "PAGE-BREAK-AFTER". I have to read this file and find this string, till that string i have to make a new file1, like that there are lot of "PAGE-BREAK-AFTER" String, Could any one tell me. How to do this, some logic.

    Thanks and Regards. SANTHOSH V

    CPalliniC 1 Reply Last reply
    0
    • S santhoshv84

      Hi Friends, I have a MHTML file, i have to Split it in to Number of files, First from the Header of the file as header. Then we have a String in as "PAGE-BREAK-AFTER". I have to read this file and find this string, till that string i have to make a new file1, like that there are lot of "PAGE-BREAK-AFTER" String, Could any one tell me. How to do this, some logic.

      Thanks and Regards. SANTHOSH V

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      That can be easily done:

      (0) if you have reached endo of file exit
      (1) Read a line and append it to your buffer
      (2) Search the line for the "PAGE-BREAK-AFTER" separator
      (3) if the separator is not found go to point (0)
      (4) write buffer content to new file
      (5) erase buffer
      (6) go to point (0)

      :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      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