How to move one row another based on column value

Hi Team,

I want to move one row to last row if expected value found.

First row “PPP” column found “MAT” than that entire row should move to last.

Please help me anyone for this.

Input:
image

Output:
image

Regards,
Raja G

Hey @Raja.G
you can use:
dataTable = dataTable.AsEnumerable().Where(Function(row) row("ppp").ToString() <> "MAT").CopyToDataTable().AsEnumerable().Append(dataTable.AsEnumerable().First(Function(row) row("ppp").ToString() = "MAT")).CopyToDataTable()


image

3 Likes

Hi @Raja.G

You can use the Excel activities to achieve it,
→ Use the Excel process scope activity and insert the Use excel file activity give the path of the excel file.
→ Inside Use excel file insert the Find\Replace Value activity to store the cell value a variable.
→ Then use the Find First\Last row Data Row activity and store the Last row value in a variable.
→ Then use the Copy\Paste range activity.
→ Then use the delete row activity to delete the row.

Check the below workflow for better understanding,
Sequence2.xaml (13.2 KB)

Hope it helps!!

2 Likes

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