@Unable to read the excel cell


#1

Hi,

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)

Thanks
Girish


#2

Any update


#3

This cell?

image


#4

Actually I was passing this value to another workflow…may be I need to split before passing into another workflow


#5

How can I split that according to next line?


#6

“one capitol mall” as a address
Another line as city
Next as a state and pin


#7
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)

#8

Thank you so much


#9

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)


#10

Can you try this?

Regex.Split(StoredREsult, "\r\n|\r|\n")


#11

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);


#12

Working I took regex as a variable of type regex but same error index out of bound exception. Please help me on this.


#13

Is it for the same excel? I get the output using Regex.

088760149dfd92f6a14e6134453551d60305438a.xaml (127.5 KB)

image


#14

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.