Results 1 to 4 of 4

Thread: Textbox,Textfile, Inputbox Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Posts
    73

    Textbox,Textfile, Inputbox Help

    I have a some information on a textfile. I want to know if someone could help me. I want to input the customers ID number in a textbox or inputbox and get all the customers information like name, address, Date of Birth, age, etc. I know how to retrieve information from a textfile by typing the name of the textfile a getting all the information in the textfile.

    What I don't know how to do is to retrieve certain information from a textfile. How can I type in the customers ID and pull up all the customers information and then store it in an array.

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Textbox,Textfile, Inputbox Help

    You forgot to mention one small detail that unfortunately happens to be the most important one. How the data in your text file is organized?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2009
    Posts
    73

    Re: Textbox,Textfile, Inputbox Help

    its line up like so:

    123456 James Smith 111 Perry Road 4/10/1980 30

    but I could change it to

    123456
    James Smith
    111 Perry Road
    4/10/1980 30

  4. #4
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Textbox,Textfile, Inputbox Help

    If the file format is currently under development I would recommend using XML or CSV.
    This will make the information easier to parse.
    XML (there is a ready-to-use parser available in VS NET):
    Code:
    <?xml version="1.0" encoding='UTF-8'?>
    <customer>
      <id>123456</id>
      <name>James Smith</name>
      <address>111 Perry Road</address>
      <born>4/10/1980</born>
    </customer>
    CSV (also can be easily read using vB.net)
    Code:
    123456,James Smith, 111 Perry Road,4/10/1980
    or Key-Value pairs (can be parsed in no time):
    Code:
    Id:123456
    Name:James Smith
    Address:111 Perry Road
    Born:4/10/1980
    Unfortunately, data that can be easily read by computer is difficult to read by human and vice versa.
    Your first example is the worst of all since you don't know where name ends and address begins, and whether 123456 is a part of the address or customer id.
    Your second example is better, because each field is started on a new line but still maintaining the information is difficult (the same with CSV - the order of fields is important).

    So what will it be: XML, CSV, Key-Value pairs or your format?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width