Splitting strings complicated

Error: Index was outside the bounds of the array

Obviously, my bad for not paying attention. Then the issue lies in your input string or the Split method. I am not sure what exactly is happening there, as it really should work.

Could you show us how the address looks like in the Excel file? My only idea is that it is written in multiple rows, and when you take the row of data you only take the first line of the address.

The adress is like this:

Any chance you could share this Excel file with just this one cell? I’d like to try some things out :slight_smile:

1 Like

I sent it in an Message

Thank you, I found the issue. You have empty rows in your Excel file and you are going over all the rows without checking if they contain anything.

The code will not work when you try to split nothing (empty cell), thus returning Index out of bound error.

Try checking if the row element is not empty before running the process, like so:

2 Likes

Thank you! will let you know when it works.
I am now busy to split the line.
Need Streetname and housnumber ass variables. Now they are at the same line.

I wanna thank everybody that helped me! I solved my problem

1 Like