Manipulating data in CSV file

Hello,

I am trying to manipulate data in a CSV file but cannot find an activity that can help me do that. My goal is to change that data in the columns from being stored in scientific notation to normal decimal notation. For example the value 2.11E+11 would be changed to 2210850000109.

Thank you in advance for your help!

@Sahil_J_Patel - when you open the csv in the notepad+ are you seeing E+ ?

When I open the CSV file I see 2.11E+11. I need to see the entire number.

@Sahil_J_Patel - that when you open the csv in excel right? I asked to check it with notepad+ or other editors…

Yes, in notepad I still see the +.

@Sahil_J_Patel - i am not sure that is correct…

Please check below…

image

image

My point is when you open the csv file in the right editor it will always show the correct value…E+ is functionality of the excel cell …not the csv. So you don’t have change anything here…you can process the file as is …

I have attached a photo that should show the E still showing up in notepad. Clipboard.pdf (587.7 KB)

@Sahil_J_Patel - Got it…Then you have to fix it by opening that in excel and change the field to text (per google :wink:) and save as CSV and then use it for further processing…

if you do not want to do this manually, then you can do it with the help of vba code.

Sorry I am still new to UI Path. What is vba code?

@Sahil_J_Patel

have a look here on the conversion demo:
grafik

so a conversion can be done with the help of a for each after read in the csv with read csv
OR
a LINQ statement

Hi @ppr … Thanks for sharing an idea.

But @Sahil_J_Patel original value is 2210850000109. But if we use Double.parse it will modify the original value right?? Correct me if I am wrong…

@prasath17
yes it has to be checked with a well known pair. this was the reason for line 3 and 4 where i used 2210850000109 and show cased the different resulting exponential result

Same result also for BigInteger:
grafik

But with a more precision we get the value:
grafik

1 Like

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