Removing specific rows in a csv file via "Filter Data Table" activity is not working

I want to remove all the rows which do not contain the letter “U” in the second column of a specific csv file.
For this I first scanned a table on a webpage with “Data Scraping”.
Then I created a csv file with activity “Write CSV” which will then be read with the corresponding activity (“Read CSV”).
At the end there is the “Filter Data Table” activity - see screenshots below:

grafik

Unfortunately the Filter Data Table activity does not recognize the column name:
grafik

And I have no clue why.
Can someone help me please?
eAnträge.7z (823 Bytes)

Hi @MarcJo, welcome to the UiPath community.
your CSV file, doesn’t contain the column name. and also it is not in correct order. while data scraping, verify the output in the pop-up window to see if the data is correctly scraped or not.

There is no need to write the data in CSV and read it again to remove the rows. data scraping’s output is in a datatable already, use the datatable’s select method to filter the data.

Hi @sanjayshaswani,
thanks for your fast reply!
When I open the file which is saved in the given path, I see the column name “Dokumente”:
grafik

However, I scraped again and my output looks like this:

The order of the columns does not really matter in order to filter them afterwards, right?

What do you mean with the datatable’s select method?
Isn’t it required to take “Filter Data Table” activity in order to remove specific rows?

Hi @MarcJo

Like DatatableNew=Datatable.Select(“[Dokumente”]=‘U’").CopyToDatatable()

Thanks
Ashwin S

can u share your xaml!

Thanks!

Hi
welcome to uipath community
you were almost done
we need to do few changes
here in the Filter datatable wizard enable REMOVE radio button as we dont need rows having “U”
and in the column name we need to mention with double quotes around and thats what the error depicts
like this “Col_name_1” unless its a variable name
image

hope this would help you
kindly try this and let know for any queries or clarificatin
Cheers @MarcJo

Hi @kadiravan_kalidoss,
please find the xaml.file attached:
Deckungsnoten SLOT 2.0.xaml (25.7 KB)
Can you tell me by the way how I can extract single sequences or activities out of a whole workflow in order to save them in a separate xaml.file?

Hi @Palaniyappan,
“Col_name_1” is a variable, so no needs for “”.
In addition, the rows containing “U” have to be kept whereas the ones without “U” have to be deleted.
But I tried both “Keep” and “Remove” in different ways. It never worked since UIPath never recognizes the column name.

1 Like

Fine
may i know what is the value of Col_name_1
and also a screenshot of the excel with its columnname if possible
i think there is a mismatch between that variable and original columnname
thats the issue

Cheers @MarcJo

Hi @Palaniyappan ,
this is the column’s name and the variable (both marked yellow)


Cheers,
Marc

Fine
i have a doubt now with the datatable whether it has that column or not
before the filter datatable activity use a assign activity and mention like this
Col_name_1 = csv_eAntrage.Columns(1).ColumnName.ToString
which will give us the column name and then we can mention that in the filter datatble wizard @MarcJo

or

directly lets mention with column index as 1
in filter wizard remove the variable name and mention as 1 in that field and try once pls
Cheers @MarcJo

Hi @AshwinS2,
thanks for your reply.
Where do I have to fill that in?
Cheers,
Marc

Hi @MarcJo
Based on assign activity use it
and to print the table use Output Datatable

Thanks
Ashwin S

Hi @Palaniyappan,
after implementing the first option, I received following error message:
grafik
Best regards,
Marc

Fine
can i have a screenshot of the expression been used in your workflow
that expression would surely give the column name
Cheers @MarcJo

What kind of expression do you mean?
Does this screenshot help?
grafik

Hi @AshwinS2,
when I put this into “Assign” activity I receive following error message:


What do I need to change/add right here?
Thanks in advance?

the expression that was used here in this assign activity
image

Cheers @

Hi @MarcJo
Do you have datatable as datatable type change to extractdatatable

Thanks
Ashwin S

It was the one you gave me:

Col_name_1 = csv_eAnträge.Columns(1).ColumnName.ToString