Add true to specific row

I am not sure how to provide value ‘True’ to a specific row in a text file (output)

I have a input.txt as

Column1, Column2, Column3, Column4,
Abc,4.5,0.05,true
Bcd,23,0.05,

What I need is
Column4 for the row Bcd should be true if 4.5*0.05=0.23, i.e 0.225(round up 23)

Here we are multiplying 4.5 of first row to 0.05 of second row

@dipon1112000,

Read the file as string and split it using the Environment.Newline character, that will give you an array. Then based on the condition, you need to update the array item, then you can write back to the text file.

If I got u right the flow will be

  1. Read text=text(string)
    2.assign xyz=text.Split(Environment.NewLine.TocharArray)
    3.for each

Am I right?

Can anyone help please

Hello

Take a look here:
Main.xaml (12.0 KB)
image

You just need to swap out the first activity with a read text file instead.

Hopefully this helps,

Cheers

Steve

Thank you for your support but not sure y I am getting error
Exception has been thrown by the target of an invocation

Hi

Run it again but in debug mode (press blue arrow).

Then show me the “Locals” pane on the left side of the screen

Below is the screenshot

Try swapping “row” to “currentrow”.

It needs to match the variable from the For each row activity.

Thank you for helping

But unfortunately it’s not working

I found the reason but don’t know how to fix

The error is coming because I am trying to write “True” to the Result (column 4 as per your XML)

But if I write the same to a new column then it’s working

Is there something that I need to do get the Boolean value printed to Result

i.e as the column “Result” has already got True printed in some of its Rows that is the reason row(“Result”) is not working and if I am declaring a new column row(“Result1”) its working

Hey

When you added the column “Result” what type of column was it?

Cheers

Steve

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