hello ,
I need to extract the second word from a row,(please look at the below example- 1 which consists of 3 or 4 or 5 letter words) i got the result using the below expression… but now i found a different case (look at example -2 which have rows with only 2 words) which am getting error,
Exmaple -1
coloumnA
1234567890 1qwe234rq aaa bold
9087654321 abc1234 gold
8901234567 acs1234 ab leee good
expression used -
left (RIGHT([coloumnA],LEN([coloumnA])-11), (INSTR(RIGHT([coloumnA],LEN([coloumnA])-11),’ '))-1 )
example 2
1234567890 1qwe234rq aaa bold
9087654321 abc1234
8901234567 acs1234 ab leee good
3456789012 asdfg12
Use yourString.Split(Environment.NewLine.TocharArray) to split it based on each new line. Then select the item by analyzing in for each and extract the second word for each item by
Split(item.ToString," ")(1)