Hi,
I need to split the strings in an excel file with “:” as my reference and anything that is left of the colon should be my column name and the corresponding value on the right side of the colon should be placed below that column name. Cells which are empty/ doesn’t have a colon must be deleted. I don’t know how to do this. Can anyone help me with this?
In this case,
you lose the countries list right. In the below image, as per your requirement countries list contains only one value Thailand and will miss the other two. Is it expected?
The missing activity here is “For Each” Loop Activity.
I developed the bot with the latest UIPath version.
There are just couple of assign activities in the for loop.
Do you want me to write those assign activities here. So you can build the missing activity.
FOR EACH [row] in [ExtractData]
--------BODY OF FOR LOOP-----------------
IF row(0).ToString.Contains(":")
---------If condition is TRUE---------
ASSIGN: iIndex = row(0).ToString.IndexOf(":")
ASSIGN: colName = row(0).ToString.Substring(0, iIndex-1).Trim
ASSIGN: tempValue = tempValue + "," + row(0).ToString.Substring(iIndex+1,row(0).ToString.Length - iIndex -1).Trim
ADD DATA COLUMN ACTIVITY:
In the PROPERTIES -
ColumnName: colName
DataTable: outDT
AllowDBNull: True
---------End of IF Activity-----------
---------END OF FOR EACH Activity--------
tempvalue is not assigned before assigning. So you are getting this error.
Add a if condition for this assign activity. If tempvalue is null, do not assign anything.