# import from Excel adds a point to each number ...How to get rid of it? [duplicate]

I import an excel file

c1  c2  c3
1   3   5
2   4   6

fp = NotebookDirectory[] <> "Book1.xls";

excelSheet = Import[fp] [[1]];
t1 = Grid[excelSheet, Frame -> All, Alignment -> Left,
Background -> {None, {Gray, {White, LightGray}}}


The table shows each number with a "." at the end :( How do I get rid of it?

c1  c2  c3
1.  3.  5.
2.  4.  6.


Thanx

Solution:

For[i = 1, i <= Length[excelSheet], i++,
For[j = 1, j <= Length[excelSheet[[i]]], j++,
If[NumericQ[excelSheet[[i, j]]],
excelSheet[[i, j]] = Round[excelSheet[[i, j]]];
];
];
];

• what should i do :( ? Commented Dec 21, 2014 at 14:34
• do you expect me to read hundred of pages of text for such a simple problem ?! Commented Dec 21, 2014 at 14:35
• Please consider the following a friendly advice. Mathematica is a tough piece of software that demands a lot of effort to tame. Every experienced user already knows and accepts that. When you write "do you expect me to read hundred of pages of text for such a simple problem ?" you should know that everybody out there have already done that, and don't consider it lost time. If you're not predisposed to invest a great deal of effort into Mathematica, don't even try. You'll feel discouraged too soon. Commented Dec 21, 2014 at 20:50
• @TraceKira excelSheet /. x_?NumericQ :> With[{r = Round[x]}, r /; r == x] is more robust, or since it's Excel, x_Real instead of x_?NumericQ. (You might not want to convert 6.4 to 6. This replacement rule will round to an integer only if the rounded value is equal to the original number.) Commented Dec 22, 2014 at 3:15

Following discussion with WRI tech support, setting Import's “Numeric” -> False has no effect on Excel files (.xls, .xlsx), but works when importing comma or tab delimited text files (.csv, .tsv).

WRI understands that "this could be very frustrating and inconvenient for you" and apologizes for this but lacks the resources to fix. So either:

(1) convert to csv (which by the way can also be exported via REST from Google gsheets)

(2) Round[] any NumericQ data after Import.

• "but lacks the resources to fix." — have you tried telling WRI that you're doing Tweetable data science of the computational world using the Internet of Things in Excel? Maybe you'll get it fixed faster that way ;)
– rm -rf
Commented Dec 21, 2014 at 16:51
• what does it means ? I cannot get rid of points ? Commented Dec 21, 2014 at 19:25
• Anything that they don't intend to fix should be clearly documented as broken. Commented Dec 21, 2014 at 22:13