Importing CSV files problem

R

Ramon Navarro

Hi Guys,

I am currently working on a project that invloves
importing of CSV files to Excel. Double-clicking the CSV
file opens the file automatically in Excel. We have
enclosed our data in quotation marks (i.e. "SomeData") to
prevent errors arising from strings that have commas as
part of the data. This works fine for us.

However, The problem arises when we import data that look
like numbers written in scientific notation but are
actually some other data which should not be expressed in
scientific notation (example "1E306" is expressed
as "1E+306").

We tried putting an apostrophe character before the data,
since this works (with the apostrophe character
invisible) when you do this in Excel, but when we
import "'1E306" from a CSV file, the ouput also has an
apostrophe (i.e. "'1E306").

We perform our test by importing a CSV file containing
the following data:

"Data","1E306"

Is there a way to import the mentioned CSV file as is or
stop Excel from automatically formatting data when you
open a CSV file?

Thanks in advance,
Mon
 
D

Dave Peterson

I think the easiest thing to do is to rename the .csv file to .txt.

Then record a macro (so you don't have to remember what you did) when you open
the file manually (File|Open).

You'll see the Text Import Wizard and you'll have complete control over what
fields are text or dates or general (or even skipped).

Then when you get data laid out the same way, just rerun the macro.

You could even enhance the macro to add headings/filters/page layout/subtotals
and make it more useful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top