How can I split column in Excel file if data that should be stored in two columns presents in one column and separted by ";“
Sequence of my process is on the pic, but it shows error on: row.split(”;"c)
Am I on right way or there are other solutions?
You need to specify the specific column you are wishing to split. So it should be row.item("ColumnName").ToString or row.item(ColumnIndex).ToString rather than just row.
I am assuming VarRow is a string array variable, correct? Because string.split will return an array of strings.
If your end goal is to split data from one column into 2, does the 2nd column exist and is blank? Or do you need to add a new column? It looks like that portion is missing from the code you have pictured as well
“A1” in an excel sheet would be the first column and the first row in your datatable. The Index for datatables starts at 0, so it would be row 0, column 0 in your datatable. so you can change it to be row.item(0).tostring, which will get the first column in every row in your for each loop. If you only wanted a single row, then remove the for each loop and change it to be DTcsv.rows(0).item(0).tostring
Anytime you see the word ‘index’ in programming it is always referring to an integer