How to get 22 digit value from .csv file


#1

Hi,
I have to read one 22 digit value from .csv file and i have to write it in .xls file. while writing the value is getting converted in exponential value, when i changed the format in excel from ‘general’ format to ‘number’ format i m getting last digits as zero.can anyone help me with this.

Thanks and regards,
Ananthaeswar


#2

Hey @Ananthaeswar2

All numbers are stored internally by Excel as 15 digit floating-point numbers. So If you want more than 15 digits you have to use Text/ String rather than numbers, and so you will not be able to do arithmetic calculations with the number.
.csv file also shows them as big numbers but only if you open the csv file with Notepad option, but that when you open the csv file in Excel, you see them as truncated and converted to scientific notation.

So to perform operations in your code convert that string or Text to Int and then perform but for writing purpose without exponentially use string format :slight_smile:

Regards…!!
Aksh


#3

Thanks @aksh1yadav for the solution.
I done that one,the problem here i will get csv file form web,the file will change dynamically,while writing in .xls file i m getting value like =“5436489635782658934864” .because they write the value in .csv file as string,how to get only value, without that quotes.

before writing is .csv fle—12345678901023456
after writing in .xls file-----=“12345678901023456”

Thanks and regards
Ananthaeswar


#4

You can even append some string common string character in front of the numbers to avoid conversion.

Example: ar_293294032502597323232

later you can remove ar_ when reading the value again.


#5

Not getting… share the sample files.


#6

Hi
i attached one sample file…in that file i gave some sample values before reading from .csv file and after writing in .xls file.sample.xlsx (10.0 KB)