I have input in CSV (not Excel as I do not have option to use Excel). I have done read CSV and then tried multiassign where I have used
Number1=Convert.toint32(current row(“column3”)).
Here I have Number1 as int32
But I am getting multiassign cannot assign
My intention to do the above flow is to divide column3 with column5
Note column3 and column5 are headers that I have created in my notepad.
I am trying to handle calculation from a file that has .CSV extension and cannot use file with.txt extension
Pls help
vrdabberu
(Varunraj Dabberu)
January 4, 2024, 2:35pm
2
Hi @dipon1112000
Could you please share the screenshot of the CSV file with columns. What is your required output.
You can try this too:
Number1= CDbl(CurrentRow("column3").ToString)
Number2= CDbl(CurrentRow("Column5").ToString)
To divide Number1 by Number2
((Number1)/(Number2)).ToString
Regards
rlgandu
(Rajyalakshmi Gandu)
January 4, 2024, 2:48pm
3
@dipon1112000
Number1=Convert.toint32(currentrow(“column3”).ToString)
Try to add .ToString I hope it will work for you
vrdabberu
(Varunraj Dabberu)
January 4, 2024, 3:18pm
4
Hi @dipon1112000 ]
Check out the below workflow:
Assuming your input is like below:
=>Use Read CSV to red the file and store the output in a datatable.
=> Use For Each row in DataTable to iterate through each row and give the below syntax in assign activity:
Number1= CDbl(CurrentRow("column3").ToString)
Number2= CDbl(CurrentRow("Column5").ToString)
Note: Number1 and Number2 are of DataType System.Double.
=> Use WriteLinew to print the values by giving below syntax:
(Number1/Number2).ToString
Output:
xaml:
Sequence9.xaml (9.8 KB)
Regards
2 Likes
Thank you so much, it worked and I can see the fraction in output too, one more help pls, can you show how to add the output to a CSV file (not Excel) as a seperate column.
Thank you for helping so far
@vrdabberu can you please help with the step to write the CSV with the output on a seperate column
system
(system)
Closed
January 9, 2024, 5:55am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.