How get data from data table if exist and regex the value with LINQ

Hi everyone, I have been trying to get data from table that contains 2 columns and the data i want to assign to the variable are selected based on the value of the 1st column. Like if the row value “A” exist in column 1 (if not exist it will return “0”) I want to get data of the same row on column 2 and at the same time i want to use regex to remove part of the string( string got from data table “EUR 12,123.32 (25.55%)” and the desired output is 12123.32

image

I managed to do this by regex entire column then save it to clone data table, but I have too many data table to extract and each time i have to get 5-6 rows from each of these extracted data table. So i try to find a way to get the data straight from the Extracted data table without doing any convertion wih LINQ if possible.

Hi @Dawid_Nguyen

Can you provide the required output also

i did, it is in the question

Hey @Dawid_Nguyen,

If the data you are reading it from the excel file, then you can do one thing you can write a macro to manipulate the data of that excel and invoke it, else if you have done after reading the data from the excel you are doing the manipulation using linq you can go with that.

If you have 5-6 datatable you can create a common workflow and invoke it and pass the datatable to it, else create a list of datatable and iterate it for all the tables.

Thanks,
Sanjit

Read Range into datatable. For Each Row in Datatable to loop through rows, and inside For Each use Switch to determine steps based on CurrentRow(“col0”).ToString value.

that image is just for example. I dont use exceland the data i have are from extracted data table on website.