Importing CSV files

  • Thread starter Thread starter D
  • Start date Start date
D

D

I want to create a CSV file to import directly into EXCEL but have the
following problem.

Say for example I want to import a Credit Card Number with the digits
4218000012344321 and other information like the first and last name.

I create the following CSV file.

"Bob","Jones","4218000012344321"
"John","Bobbins","4218000043211234"


When I double click the CSV file, it opens in Excel but the following
happens

Column A will have BOB and John - which is correct
Column B will have Jones and Bobbins - again which is correct
but Column C will have 4.22E+15

How can I make it appear as it should 4218000012344321 & 4218000043211234 ?

The same holds true if I remove the " around the credit card number.


Thanks in Advance
==============================
 
Rename your .csv file to .txt.

then when you open the file, you'll see the text to columns wizard.

Choose Text for that 16 character credit card number field.

(excel keeps track of 15 significant digits in numeric fields.)
 
D,

I think Dave has hit your question right on for opening the text file. If
you'll be doing this regularly, and have Excel 2000-up, you may want to
import it instead. Read more at www.smokeylake.com/excel/textfiles.htm.
The page isn't finished, but it might be helpful to you.
 
That's great, but I guess the question then becomes how can I display 16
numbers as text automaticaally without having to use the wizard ?
 
If your input file is always laid out the same way, you could record a macro
that does the import.

Just "Tools|macro|record new macro"
then open your file.

I'd continue recording the macro while I inserted headers/set the page
layout/added Filters--anything that has to be done the same way each time.

Then whenever I wanted to import a new version, I'd open this workbook and run
the macro.
 
VENKAT,

When you open a text file, it's read into a new sheet; you need to use the
Import Wizard to specify the formatting of the new sheet. When you import,
it's read into an existing sheet, which you could pre-format as you mention.
Read more at www.smokeylake.com/excel/textfiles.htm.
 
Back
Top