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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. reading each line and creating a file with that line

reading each line and creating a file with that line

Scheduled Pinned Locked Moved Visual Basic
csharphelpcareer
6 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.
  • N Offline
    N Offline
    nicetohaveyou
    wrote on last edited by
    #1

    I have a text file in c:\ as abc.txt which displays empid=e001, name=john, salary=5000 .. ... ..... Now, we need to have a method which wil take empid as parameter and will find the line with the empid and create a text file with that line e.g if we pass e001 to the method it will write empid=e001, name=john, salary=5000 to a new file with the name e001 So all these files created will be stored in a folder c:\repository Could you please help to code that in vb.net. Many thanks

    C D 2 Replies Last reply
    0
    • N nicetohaveyou

      I have a text file in c:\ as abc.txt which displays empid=e001, name=john, salary=5000 .. ... ..... Now, we need to have a method which wil take empid as parameter and will find the line with the empid and create a text file with that line e.g if we pass e001 to the method it will write empid=e001, name=john, salary=5000 to a new file with the name e001 So all these files created will be stored in a folder c:\repository Could you please help to code that in vb.net. Many thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Sound trivial, a little bit of regex, some basic file management code. In fact, string.Split would do it fine. Perhaps if you don't know how to do it, you should advertise for someone to write it for you. Be careful tho, a lot of the people who place low bids on projects nowadays, barely know how to type. They come here and post their projects and hope someone will do it for them.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      C 1 Reply Last reply
      0
      • C Christian Graus

        Sound trivial, a little bit of regex, some basic file management code. In fact, string.Split would do it fine. Perhaps if you don't know how to do it, you should advertise for someone to write it for you. Be careful tho, a lot of the people who place low bids on projects nowadays, barely know how to type. They come here and post their projects and hope someone will do it for them.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        My reply actually contained all the info someone would need to write this code, but I get a 1 vote for not doing the work for you ? I'm happy to provide my contract rates.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        T 1 Reply Last reply
        0
        • C Christian Graus

          My reply actually contained all the info someone would need to write this code, but I get a 1 vote for not doing the work for you ? I'm happy to provide my contract rates.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          T Offline
          T Offline
          Tom Deketelaere
          wrote on last edited by
          #4

          Evened it out for you :) I guess the guy can't read since you did give him the answer to his question all be it in a somewhat obscure form :)

          C 1 Reply Last reply
          0
          • T Tom Deketelaere

            Evened it out for you :) I guess the guy can't read since you did give him the answer to his question all be it in a somewhat obscure form :)

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            I try to always give answers that a programmer, or someone who has read my article on how to use google, should be able to use to solve their problem. I don't really provide code often anymore.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            • N nicetohaveyou

              I have a text file in c:\ as abc.txt which displays empid=e001, name=john, salary=5000 .. ... ..... Now, we need to have a method which wil take empid as parameter and will find the line with the empid and create a text file with that line e.g if we pass e001 to the method it will write empid=e001, name=john, salary=5000 to a new file with the name e001 So all these files created will be stored in a folder c:\repository Could you please help to code that in vb.net. Many thanks

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              This is simply knowing how to manipulate strings and files. If you don't know these simple techniques, you really have no business even starting this project. Seriously, if you want to continue to write code, pickup on beginners book on VB.NET and work through it. Without these basic concepts, you have no hope of completing the simplest of projects, like this one.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              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