# 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 :( ? – TraceKira Dec 21 '14 at 14:34
• do you expect me to read hundred of pages of text for such a simple problem ?! – TraceKira Dec 21 '14 at 14:35
• Please read this: mathematica.stackexchange.com/a/18485/131 – Yves Klett Dec 21 '14 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. – Dr. belisarius Dec 21 '14 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.) – Michael E2 Dec 22 '14 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).
(2) Round[] any NumericQ data after Import.