Split the excel data


I want to split the data and i have a multiple data in excel file, as u can see highlighted data wat is input and output , so please give me answer

thanks

Assign Activity
dtSplitResult | DataType: DataTable = YourDataTableVar.Clone()

Assign Activity
dtSplitResult | DataType: DataTable =

(From d in YourDataTableVar.AsEnumerable
From s in d("Things").toString.Trim.Split("/"c)
Let ra = d.ItemArray.Take(3).Append(s).Cast(of Object).toArray
Select r = dtResult.Rows.Add(ra)).CopyToDataTable
2 Likes

Please create a UiPath code for this answer

the shared is UiPath Code as it will use the Assign Activity as described above (Variables, Left side, right side)

When it is about decomposing the LINQ into essential modelling we can do

Assign Activity
dtSplitResult | DataType: DataTable = YourDataTableVar.Clone()

For each row in datatable | row in dtOrigVar

  • For each Activity | item in row("Things").toString.Trim.Split("/"c)
    • Add Datarow Activity
    • | DataTable: dtSplitResult
    • | RowArray: row.ItemArray.Take(3).Append(item).Cast(of Object).toArray

Hi @UJJVAL_BHAGAT

Below zip file should help you.

BlankProcess3.zip (153.9 KB)

Regards

Find some visuals below:

The LINQ Approach

The Decomposed Approach

1 Like

then the error is “item is not decleard” in the Add data row activity

@UJJVAL_BHAGAT
Sequence1.zip (952 Bytes)



Hope it works for you

@UJJVAL_BHAGAT

If it works for you please mark this as solution so the loop closes.
Thanks &Regards

Hi @UJJVAL_BHAGAT

If the solution works please mark my post as solution to close the since LINQ expressions are much faster in execution than in loops. As it is reporduced through UiPath Code in simple way and provided. Or if you have any queries let us know so that we can help you.

Regards

it depends on how you have configured the loop variable:
grafik

so it is:
row.ItemArray.Take(3).Append(currentItem).Cast(of Object).toArray

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.