Importing long numerical identifiers into Excel

Posted by Niels Basjes on Super User See other posts from Super User or by Niels Basjes
Published on 2012-10-03T21:29:53Z Indexed on 2012/10/03 21:42 UTC
Read the original article Hit count: 269

I have some data in a database that uses ids that have the form of 16 digit numbers. In some situations i need to export the data in such a way that it can be manipulated in excel.

So i export the data into a file and import it into excel.

I've tried several file formats and I'm stuck.

The problem I'm facing is that when reading a file into excel that has a cell that looks like a number then excel treats it as a number.

The catch is that (as far as i can tell) all numerical values in excel are double precision floating point which have a precision of less than 16 digits. So my ids are changed: very often the last digit its changed to a 0.

So far I've only been able to convince excel to keep the Id unchanged by breaking it myself: by adding a letter or symbol to the Id. This however means that in order to use the value again it must be "unbroken".

Is there a way to create a file where i can specify that excel must treat the value as a text without changing the value? Or its there a way to let excel treat the value as a long (64bit integer)?

© Super User or respective owner

Related posts about microsoft-excel

Related posts about Corruption

  • help! corrupt file recovery

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    My supervisor computer crashed last night, and I'm trying to help him out. He made an R script but when he tried to open it, it was empty. But for some reason the file is 7.9kb so it should not be empty i think... anyway when i tried to open it, Gedit gave this error: "The file you opened has… >>> More

  • Login screen restarts while entering password

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am having a problem that only occurred after installing the fglrx proprietary driver through the additional drivers app. The exact same issue is described in this question, however it's closed. Must login twice before entering Unity; first login screen has graphical anomalies When I boot up my… >>> More

  • Delete corrupted folder

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am trying to delete a folder in my home directory; its name is completely garbled. In Nautilus, the garbled text is followed by 'Invalid Directory.' Deleting it with Nautilus stalls; I can't type in the garbled name in the terminal. peter@io_vbox:~$ ls -lbdR * ... drwxrwxr-x 3 peter peter … >>> More

  • Error while installing netbeans

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I tried to install NetBeans 7.2 from a downloaded .sh file, but experienced problems. Here's text from the Terminal, which shows what I did and what happened: hridesh@ubuntu:~$ cd Desktop/ hridesh@ubuntu:~/Desktop$ cd full\ netbeans\ 7.2\ for\ linux\ in\ .sh\ format/ hridesh@ubuntu:~/Desktop/full… >>> More

  • How do I fix a corrupted harddrive after failed upgrade?

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    The problem originated when I was trying to fix this problem. Things went horribly, horribly wrong and I ended up with a new problem altogether. The last thing I did was run sudo apt-get install and that caused my system to freeze. I restarted my computer and it would not boot from the harddrive… >>> More