Question

I am looking to convert a scientific notation number into the full integer number.

E.g:

8.18234E+11 => 818234011668

Excel reformatted all my upc codes within a csv and this solution is not working for me.

I have my csv open in Notepad++ and would love to do this using a regex find and replace.

Thanks.

Was it helpful?

Solution

The damage is already done and cannot be recovered from the CSV file. 8.18234E+11 could be anything* from 818233500000 to 818234499999.

To prevent Excel from rounding large numbers, you need to store them as text. If you set the cell format to text, any value inserted from then on should be automatically interpreted as text. In OpenOffice Calc (I don't have MS Excel), you can also prefix a numeric value with ' to get it interpreted as text no matter the cell format.

There is a chance that the correct value is stored in the original XLS (or XSLX or ODS or the live Excel session or ...) file. If not, then you'll have to enter the data again. If the data is there, you need to store it as text or increase the number of significant digits in the exported CSV. If you only have the exported data, then you're out of luck.

*UPC has a single check digit, so only 100 000 out of the 1 000 000 codes are actually valid UPC codes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top