Excel String data

jk0607

Member
I have a excel file which has scraped data in a single line. How do I get the required data from that single string.

Example: SID 45666645 james Nesham 89 48.59.158.2 jamesN0607@gmail.com PYTM 8989.52


This is something i've in excel file but I would required to get the email, SID , Pytm amount. Please help me how to do it. I tried few things from the blog but wasnt helpful enough.


Thanks in advance!
 

bnastase

Member
Hi

If you have that line in a single string you can use the Split method.

I am attaching a link for how to use that. The output of the split method will be an array of strings, it will split your string based on a character you put in, in your case a space.

Assuming your string is stored into a variable called infoString, you will have to do the following things:

1. Create a new Array of strings called arrayInfo
2. Put in an assign: arrayInfo = infoString.Split(" "c)
info - the c at the end transforms the space character string to a char variable.
3. You can nou access the information in the array by using the following syntax: arrayInfo(0) --> this will display SID ; arrayInfo(1) --> will display 45666645 etc.

KR
Bobby

Edit: Link https://www.dotnetperls.com/split
 
Top