I can able to read the cell with single word without newline in excel but unable to read if multiple lines inside the cell.
PFA.
I need to the cell in column “Address Line1” 9Location Data Cleansing_RawData - Copy1.xlsx (14.5 KB)
String[] lines = Split(Address.Trim, Environment.NewLine)
validate lines count here and based on that perform below logic
address = lines(0)
city = lines(1)
State = Split(lines(2)," ")(0)
Pin= Split(lines(2)," ")(1)
Getting Index out of bound exception. Please help me.
I think it is not splitting properly.
validated the count it is not splitting
PFAMain.xaml (124.5 KB)
Imported the System.text.regular.expression namesapce
used the below syntax:
Regex.split is not working (Split method in not populating)
string substrings = Regex.Split(input, pattern);
If it is single line I should not split.
If it multiple lines I need to split the string
If cell having multiple line I have to split it.
By using regex it will always return 1 as index. I want number of lines to assign the city and address and pin and state.
Perfect. It is working now.