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. Managed C++/CLI
  4. Read 1000 Lines from text file in a single shot ........

Read 1000 Lines from text file in a single shot ........

Scheduled Pinned Locked Moved Managed C++/CLI
questionc++iostutorial
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
    spalanivel
    wrote on last edited by
    #1

    Hi, Below is the line of code(C++) for Reading the Textfile line by line. CString = strFilePath; // text path file path ifstream Textfile; Textfile.open(strFilePath,ios::in); std::string value; while(!Textfile.eof()) { getline(Textfile,value); // Read line by line... } Textfile.close(); Now the question is I am having 40MB text file size. I need to read 1000 Lines in a single shot (And upto read 1000 times to reach the whole 40 MB size) not line by line. How to do this? reg, Subbu

    T 1 Reply Last reply
    0
    • S spalanivel

      Hi, Below is the line of code(C++) for Reading the Textfile line by line. CString = strFilePath; // text path file path ifstream Textfile; Textfile.open(strFilePath,ios::in); std::string value; while(!Textfile.eof()) { getline(Textfile,value); // Read line by line... } Textfile.close(); Now the question is I am having 40MB text file size. I need to read 1000 Lines in a single shot (And upto read 1000 times to reach the whole 40 MB size) not line by line. How to do this? reg, Subbu

      T Offline
      T Offline
      teejayem
      wrote on last edited by
      #2

      you're still in the wrong forum.

      Don't be overcome by evil, but overcome evil with good

      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