Ask Your Question
0

Import from excel problem

asked 2017-11-23 09:48:41 +0200

griswolf gravatar image

I have an xls file that is auto-generated by a web site I use. No choice about format: They provide .xls file and nothing else. Several of the cells have what _should_ be text, but is all numeric holding 18 characters. Like this: 821566612059527774. By the time I see it in Calc, it has already been converted to a number with loss of precision, like this: 8.21566612059528E+017. I can see that the original xls file holds the correct data (emacs can open it). I can figure out no way of preserving the data as text while the import happens: The options dialog only wants me to choose a language.

Is there some other way to do an import? Can I somehow import the .xls file into the cells of an existing table where I have already set the column type? Something else?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-11-23 10:01:33 +0200

I can see that the original xls file holds the correct data (emacs can open it)

Ergo: not xls, but XML with false extension (well, this has nothing to do with the problem, though).

821566612059527774 ... converted to a number with loss of precision, like this: 8.21566612059528E+017

Provide a sample file please. I suspect that the data is numeric in the file to begin with (i.e., the cell format defined by generating software is numeric, not textual), so there's no way for Calc to guess that you want it to be text. But worth checking.

edit flag offensive delete link more
0

answered 2017-11-24 01:15:16 +0200

erAck gravatar image

If the file contains actually CSV data (raw data separated by comma or other delimiter) despite its .xls extension (highly likely) then forcing it to open as CSV and setting the column type in the import dialog to Text should solve the problem. To force the file to open as CSV best rename it to the extension .csv before opening.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-11-23 09:48:41 +0200

Seen: 287 times

Last updated: Nov 24 '17