# Delete Row using DataTable

**URL:** <https://forum.uipath.com/t/delete-row-using-datatable/246101>\
**Category:** Academy Feedback\
**Tags:** datatable, excel, system, uiautomation, activities\
**Created:** [August 18, 2020, 4:41pm UTC](https://forum.uipath.com/t/delete-row-using-datatable/246101 "2020-08-18T16:41:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prititit](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prititit/32/176941_2.png) [@prititit](https://forum.uipath.com/u/prititit)\
**Post date:** [August 18, 2020, 4:41pm UTC](https://forum.uipath.com/t/delete-row-using-datatable/246101/1 "2020-08-18T16:41:26Z")

</div>

Hello,

I want to delete specific row with a sorrounding text of “F.R” in the Doc Title column

 ![image](https://global.discourse-cdn.com/uipath/original/3X/6/6/662322eb60e82603ee46d58d76e4d9a7ab745546.png)

---

<div class="post-metadata">

**Author:** ![alin.c.mihalea](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/alin.c.mihalea/32/133577_2.png) [@alin.c.mihalea](https://forum.uipath.com/u/alin.c.mihalea)\
**Post date:** [August 18, 2020, 4:52pm UTC](https://forum.uipath.com/t/delete-row-using-datatable/246101/2 "2020-08-18T16:52:04Z")

</div>

Hey, @prititit,

Try this:

1. Read the excel file and store the datatable in a variable.
2. Assign  
`dt = dt.AsEnumerable().Where(function(x) Not x("Doc title").ToString.Contains("F.R.")).CopyToDatatable`

Happy automation!

---

<div class="post-metadata">

**Author:** ![1996](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/1996/32/291775_2.png) [@1996](https://forum.uipath.com/u/1996)\
**Post date:** [August 18, 2020, 4:54pm UTC](https://forum.uipath.com/t/delete-row-using-datatable/246101/3 "2020-08-18T16:54:10Z")

</div>

Hi @prititit,

Check this below link

> [@Deleting particular Row from excel](https://forum.uipath.com/t/deleting-particular-row-from-excel/134571):
>
> how do i delete a particular row from excel which contain report date as “-”?

Or

Try below steps, hope this helps you.

1. Read [excel](https://forum.uipath.com/search?q=excel%20status%3Asolved) into datatable [ReadRange Activity]
2. Filter data table using below conditions [Filter Datatable Activity]  
a. Select “Remove”  
b. Doc Title = “F.R”  
c. Doc Title contains “F.R”  
d. Doc Title “Starts with “F.R”
3. Save the filtered data table into [Excel](https://forum.uipath.com/search?q=excel%20status%3Asolved).

After filtering we need to add back to data table using add data row activity.

Please try this, if this does works, mark as solution.

Thanks,  
Neelima.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [August 21, 2020, 4:54pm UTC](https://forum.uipath.com/t/delete-row-using-datatable/246101/4 "2020-08-21T16:54:19Z")

</div>

Closed on August 21, 2020, 4:54pm UTC

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