Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NETParsing
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 21-Feb-13 9:12am
Comments
ryanb31 at 21-Feb-13 15:34pm
   
How can it be parsed? Is the data delimited by something?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 1,300
1 Sergey Alexandrovich Kryukov 660
2 OriginalGriff 309
3 ravikhoda 300
4 Manas Bhardwaj 240
0 Sergey Alexandrovich Kryukov 11,194
1 OriginalGriff 6,867
2 Peter Leow 4,795
3 Abhinav S 3,838
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid