Hi
I have a datable with the names of files in a folder. I am trying to perform a string operation on all the values of the data table. I need to extract only the name of the company from the row. Can anyone help me with it. I am new to UIpath.
Hi
I have a datable with the names of files in a folder. I am trying to perform a string operation on all the values of the data table. I need to extract only the name of the company from the row. Can anyone help me with it. I am new to UIpath.
Hi
Welcome to uipath community
yah this can be done with REGEX or split method inside the FOR EACH ROW loop
if possible can we have an example
Cheers @Ankita_Biswas
@Ankita_Biswas
Welcome to our community
you can try this
out_dt.Rows(0)(“column_name”).ToString
0 is the row index
Can you please eleborate in steps, I have done the following steps.
Thanks
Fine
inside the for each row loop use this in assign activity
str_output = Split(row(“yourcolumnname”).ToString,“-”)(0).tostring
Cheers @Ankita_Biswas
Can i store the output in some other datatable? How can i see the output?
yes you can of course
before FOR EACH ROW loop use BUILD DATATABLE ACTIVITY and create a table with one column of type string named “Mapped company” and get the output with a variable of type datatable named finaldt
–now inside the FOR EACH ROW loop use a ADD DATA ROW activity next to the abovve assign activity and mention the arrayrow property as {str_output} and in datatable mention as finaldt, so that it will add that splitted value to a datatable
–then we can use write range activity next to this for each row loop and write that to a excel file
Cheers @Ankita_Biswas
May I know why do we use this assign activity
It’s not per the sequence buddy
After add Datarow and for each row activity we can directly use write range activity
Cheers @Ankita_Biswas
After Read Range :— Dt1
use Assign in that copy that datatable to other say
Dt2=Dt1
Then In For Each Row for Dt2
Assign
Row(“Company Name”)=Row(“Company Name”).tostring.split("-"c)(0)So now in Dt1 your original Data and in Dt2 the updated data
You can see the output datatatble in message box by using
Output Datatatble and Message Box Activity
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.