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. Visual Basic
  4. how to read only modified data from a textfile which is continously changing

how to read only modified data from a textfile which is continously changing

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
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
    sourabhj
    wrote on last edited by
    #1

    hi everybody iam working in project in which the textfiles are continously changed ,or some data, is added to it by another application and i have to filter the textfiles and save it to another file and i have to process 56 files at a time and if all are processed continouslty cpu usage comes to 100% so i need to do something so that only the modified data which has addded to the file since last filteration done by my application so how can i do so can anyone guide me to do so thanks original text file format is like 20062511.095525,34444,566,7 and i have to filter it as 11/25/2006,95525,34444,34444,34444,34444,5666,7 pls guide me thanks sourabh

    S 1 Reply Last reply
    0
    • S sourabhj

      hi everybody iam working in project in which the textfiles are continously changed ,or some data, is added to it by another application and i have to filter the textfiles and save it to another file and i have to process 56 files at a time and if all are processed continouslty cpu usage comes to 100% so i need to do something so that only the modified data which has addded to the file since last filteration done by my application so how can i do so can anyone guide me to do so thanks original text file format is like 20062511.095525,34444,566,7 and i have to filter it as 11/25/2006,95525,34444,34444,34444,34444,5666,7 pls guide me thanks sourabh

      S Offline
      S Offline
      Steve Pullan
      wrote on last edited by
      #2

      Seems like a convoluted way of doing things to me. If you have the opportunity to redesign it so that the data is stored in a database of some sort rather than text files then you'll have a much more robust solution. The only way you can detect that a file's contents have actually changed is to read it. The way you can tell if a file has been touched (i.e. written, modified or created) is to inspect the file's creation date or modified date in the file system. At the very least you'll then be able to detect and read only the changed files and not all 56. As an advanced topic you can also be advised of a file's change of status by some system events, but this is I think beyond the scope of this forum. There are articles on The Code Project that discuss this issue if you wish to pursue it. ...Steve 1. quod erat demonstrandum 2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once :-)

      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