Delete line based on a condition into datacell table

HI All,

Im scrapping a web table and the result store in a datatable “TableA”, sometimes in one of the column “COL1” the data store in this format :

In this case i need to delete the line, in order to store in this format:

Any help about it ?

Hi @Marcos_Suarez1 ,

You can do this 2 ways.

  1. Check with the string.trim(length). If it is less than 2 then delete the row
  2. Check with row contains("."). If true delete. Note: copy the .(dot) from the row

@Marcos_Suarez1

Use Filter DataTable for that

Hope this will help you

Thanks

Tha Manjula !!
Last question in order to test it right now, how can i delete that specific line ?

Hi Srini84,
It doesnt work because the data cell is not empty.

@Marcos_Suarez1

You can see the output by using the output datatable activity and write line to get the output

There you can copy the symbol and put the symbol in the filter datatable

like Select Remove
“Column1” = copied string which is “.”

Hope this may help you

Thanks

Hi @Marcos_Suarez1 ,

Run your table in for each data row loop and write the required rows into new datatable.

I’m not good at linq query so i would do this way :wink:

there is a missunderstanding, i dont have to delete the entire row in case datacell contains specific string…i need to apply a data cleansing activitie into a data cell.

@Marcos_Suarez1

You can put as many conditions you can in Filter Datatable

image

Hope this may help you

Thanks

Yes, i know that but i will never need to filter a entire row…i just need to remove lines inside a row.

Hi @Marcos_Suarez1 ,

Is it possible to share the sample excel data and what line you need to remove. Then it would be easy to give the exact solution.

As per your previous reply you need to do the cleansing activity into data cell then you have to split the data element by new line if it coming in new line. Then you can perform the remove activity and update to the row cell.

Thanks,
Manjula