How to maintain formatting when importing Excel spreadsheet?

  • Thread starter Thread starter Fred
  • Start date Start date
F

Fred

Is it possible to maintain formatting information when importing
data into a table from an Excel spreadsheet, with formatted
numbers? For example, if a column in the spreadsheet contains:

00123.76
00456.91
01654.00

When I import them, they drop the leading and trailing zeros,
and the above numbers are imported as:

123.76
456.91
1654


-Thanks
 
Fred said:
Is it possible to maintain formatting information when importing
data into a table from an Excel spreadsheet, with formatted
numbers? For example, if a column in the spreadsheet contains:

00123.76
00456.91
01654.00

When I import them, they drop the leading and trailing zeros,
and the above numbers are imported as:

123.76
456.91
1654


-Thanks

First step is to realize that leading zeros don't exist in numbers.
They can only exist in text. If you can import the data as text into a text
filed the leading zeros will be there. If at any time they become numbers,
they will be lost.

The real question is what is the data. If it is really text and not a
number (in other words you don't want to sort, or compute using them as
numbers) then it is best to keep them as numbers.

HINT: add a dummy record on line 2 right under the headings using text
(like ABC) and the whole column should import as text.

If you need to use the data as numbers, you can display it with leading
zeros using various tricks. Usually the format function will take care of
it.
 
Back
Top