Results 1 to 5 of 5

Thread: How to retrieve parameters from a text file

  1. #1
    Join Date
    Apr 2009
    Posts
    79

    How to retrieve parameters from a text file

    Hello, I want to create a windows console program that receives as parameter as input a text file which I have set in the translate format, which must contain 5 values, I read the file, and be able to recover the 5 values and then insert them into my database I do not know how do I define the format of for my file, if you have an idea,please suggest me this is because i am trying this since very long time.

    Thanks in Advance

  2. #2
    Join Date
    Jan 2009
    Posts
    143

    Re: How to retrieve parameters from a text file

    Hi!

    If really need to retrieve the parameters from the text file with the 5 values you should be aware that this value corresponds to what or what is important and once you have been recovered, you insert them in your base "randomly"?

    If you must know that such a value corresponds to chose you can make a couple of species <Key/Value> or <Key=Value>, etc.. with a pair per line.

  3. #3
    Join Date
    Apr 2009
    Posts
    79

    Re: How to retrieve parameters from a text file

    Thanks, i was eager to know about this, you have really provided me the key value, i understood that I need to create a method in which I have to give the file path, it will read the file and then retrieves the value and insert them into the database, if i am mistaking somewhere then please explain me with the example. * I'm interested!

  4. #4
    Join Date
    Jan 2009
    Posts
    143

    Re: How to retrieve parameters from a text file

    Hi,

    If you have gone through the some blogs or forums reading then you can play with StreamReader and function Split () on strings but before going through this you must have some knowledge about it about how to read & retrieve the key and the value of a line.

    I will explain with the little informative, StreamReader constructor takes a file to read it as a parameter and you can then read (using the Read () or ReadLine ()) your StreamReader until it return null.

  5. #5
    Join Date
    Jan 2009
    Posts
    99

    Re: How to retrieve parameters from a text file

    The idea of a method to return the result is a good idea but thought that it must return, how you want to use it then.

    And if you give a file to be read as a parameter to this method, you arrange for the method takes a string as a parameter (not a StreamReader).In short, you have perhaps been a little fast but they are small details of inattention.

Similar Threads

  1. Running Powershell script with batch file with parameters?
    By Jaslein in forum Software Development
    Replies: 3
    Last Post: 12-01-2011, 03:36 AM
  2. ADMT Option File Parameters
    By Scott J. Peterson, MCSD, MCPSB, MCT in forum Windows Server Help
    Replies: 5
    Last Post: 16-04-2010, 05:36 PM
  3. How do i retrieve lost file
    By Anwar in forum Windows Software
    Replies: 6
    Last Post: 15-04-2009, 01:09 PM
  4. Reading text string from text file (PHP)
    By Moderate in forum Software Development
    Replies: 3
    Last Post: 16-01-2009, 03:27 PM
  5. Retrieve a file sent with email
    By Icarusul in forum Technology & Internet
    Replies: 3
    Last Post: 03-10-2008, 05:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,205,594.51621 seconds with 16 queries