Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-05-2009
Member
 
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
Reply With Quote
  #2  
Old 09-05-2009
Member
 
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.
Reply With Quote
  #3  
Old 09-05-2009
Member
 
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!
Reply With Quote
  #4  
Old 09-05-2009
Member
 
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.
Reply With Quote
  #5  
Old 09-05-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 11:06 PM.