Compare and pass Boolean in the next column

I have two CSV file (not Excel)

The first one has input as
Column1,Column2,Column3,Column4,Column5
FFX,90,FCC,0.4,0.004

The Second one has input as
Column1,Column2,Column3
FCC,1020,0.004

I am looking to get Column6 added to first CSV with Boolean value as True if FCC value 0.004 matches

If not then Column6 should have false.

I have notepad as input and want Boolean added to input first

Hey @dipon1112000
If I understood you correctly, there is script which you need:
BlankProcess63.zip (3.5 KB)

image

1 Like

Thank you for your help, what is the variable selected for matchFound?

Secondly if I have

The first one has input as
Column1,Column2,Column3,Column4,Column5
FFX,90,FCC,0.4,0.004
SST,90,CCT,0.5,0.006
CCV,90,CST,0.9,0.008

The Second one has input as
Column1,Column2,Column3
FCC,1020,0.004
CCT,1060,0.006
CST,1050,0.008

I want to add an additional column (column 6) with Boolean true if column 3 (of second CSV) matches column 5 (of first CSV)

That is

Column6
True
True
True

Can anyone help pls here

In which sheet you want to add 6th column?

Hi @dipon1112000

=> Use Read CSV to read the text files and store it in data tables.
Input1:
Output:dtFirst


Input2:
Output:dtSecond

=> Use Add Data Column to add “Column 6” to dtFirst datatable.
=> Use For Each row in datatable to iterate through dtFirst and give me below syntax in assign activity:

CurrentRow("Column6")= (From secondRow In dtSecond.AsEnumerable() Where secondRow("Column3").ToString() = CurrentRow("Column5").ToString() Select True).FirstOrDefault()

=> Use Write CSV to write the output to a text file
Output:

Workflow:


xaml:
Main.xaml (8.7 KB)

Hope it helps!!

Add new column to Sheet1 and the Boolean should be true or false if data of column 5 (sheet 1) matches/do not match to data of column 3 (sheet 2) (provided column 3 of sheet 1 = column 1 sheet 2)

Thank you for your help but I am getting false as result (though the value of target and base columns are matching

I have input.csv in dt1 as

And second input.csv in dt2 as

So as per requirement
Column TAX of input.csv (first) = TAX_TYPE of input.csv (second)
And
Column Percent of input.csv (first) = TAX_RATE of input.csv (second)

Hi @dipon1112000

If possible could you please attach the text files.
Regards

input1.txt (221 Bytes)
input2.txt (124 Bytes)

if
Column TAX of input.csv (first) = TAX_TYPE of input.csv (second)
And
Column Percent of input.csv (first) = TAX_RATE of input.csv (second)

then pass Boolean (true or false) to Column6 (need to be added) in input.csv(first)

Hi @dipon1112000

Please check the below workflow and I have attached the workflow and output files for better understanding.


Main.xaml (20.5 KB)
output.txt (284 Bytes)

Regards

thank you but I am unable to access the xml file as it is not opening up can you send a zip

Hi @dipon1112000

Please check now
BlankProcess1.zip (2.6 MB)

Regards

Hi @dipon1112000

Try this
Test.zip (2.8 KB)

Happy Automation :slight_smile:

Thank you so much but I am getting this error

Hi @dipon1112000

After AsEnumberable you have given ). Pass the below syntax:

(From secondRow In dt21.AsEnumerable()
Where secondRow("TAX_TYPE").ToString()= CurrentRow("TAX").ToString()
Select True
).FirstOrDefault()

Regards

do i need to remove column1 as shown in the flow

I have not removed but the result is coming false

Column6 is coming false for all entries

@dipon1112000

I tried with your input files and it’s working fine at my end. Please check

Regards

thanks you for helping I tried your step too but the output is coming as false

@dipon1112000

Check again

On you given two input, below are result.
input1.txt (221 Bytes)
input2.txt (124 Bytes)

1st Row return TRUE

image