Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can someone give me a sample of the right way the parse a textbox with mutilpe lines of
data and send that data into named text boxes ?

I don't want anyone to do all the work ... just get me going the right way ..

I have:

Name
Address
City, State, zipcode
Phone

I want to send it to:
txtName, txtAddress, txtCity, txtState, txtZipcode & txtPhone

If someone will get me started I think I can figure it out.
thx
Posted
Comments
ZurdoDev 21-Feb-13 15:34pm    
How can it be parsed? Is the data delimited by something?

Where is the info stored in a multiline Textbox?
Answer: in the Lines array: MSDN[^]

So, if you scan through each line in the array, you should find 4 lines which contain information - if you don't the problem gets larger, because you have to work out which lines you do have, and that gets complicated.

Is that enough for the moment?
 
Share this answer
 
Not quite.

I have 6 pieces I need to seperate so I can jam the data into the
named fields. Using an array seems the more advanced way, wouldn't
simple parsing of each line looking for the data be easier?

I have no experience but as the data is formatted the same everytime in the
large textbox i.e.

Name
Address
City, State ZipCode
Phone

What reading I have tried to figure out says I should loop thru the
text, I know the 1st and 2nd lines are Name, Address, then the 3rd
line has to be parsed looking for the comma and then anything between
the comma and the numbers is the state and finally the last line is
always the phone. My issue is I don't know how to start the parsing
so I can test the results over and over until I get it right.

thx.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900