How to convert value of a row
If a column has multiple rows
Column
0.05
0.23
1.475
1.433
Then the output should be
Column
0.05
0.23
1.48
1.43
This need to be handled in a notepad and not Excel
How to convert value of a row
If a column has multiple rows
Column
0.05
0.23
1.475
1.433
Then the output should be
Column
0.05
0.23
1.48
1.43
This need to be handled in a notepad and not Excel
Have a look here:

String.Join(Environment.NewLine, File.ReadLines("C:\Users\rlgandu\Downloads\N1.txt").Select(Function(line, index) If(index = 0, line, Double.Parse(line).ToString("F2"))))
Output:

modifiedContent=String.Join(Environment.NewLine, str1.Split(Environment.NewLine.ToCharArray()).Select(Function(line) If(Double.TryParse(line, Nothing), Math.Round(Convert.ToDouble(line), 2).ToString(), line)))
Hope it helps!!
Hi thanks a lot but can I use the below format
String.Join(Environment.NewLine,column(“Percent”).Select(Function(line, index) If(index = 0, line, Double.Parse(line).ToString(“F2”))))
As the fraction is present in column (Percent)
@dipon1112000
we would recommend the following
just ensure that the delimiter char is correctly defined
Sequence:
Read Text File activity (output variable: notepadContent)
Assign activity:
transformedContent = String.Join(Environment.NewLine, notepadContent.Split(Environment.NewLine.ToCharArray, StringSplitOptions.RemoveEmptyEntries).Select(Function(value) If(String.IsNullOrWhiteSpace(value), value, Double.Parse(value).ToString(“F2”))))
Write Text File activity (input: transformedContent)
hi I have input as text1 but I have called it under read CSV with dt1 as datatable. So what should I write before Split (as the requirement is to convert the value of “Percent” (name of the Column) which is getting added to dt1 based on division method
Thank you very much, can you share the xaml
as it is just about 3 Activities, start to modell it by your own.
The XAML has a too high risk to be incompatible with your UiPath Studio Project.
we used
row("Column") = CDbl(row("Column").toString.Trim).ToString("F2")
Thank you
very much ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.