Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Forcing Excel to Import .CSV data

Does anyone know if it is possible to configure Excel to recognize
that when opening a .CSV file, the Import Wizard should be used?

We use a lot of .CSV files here, and many users have problems when
they double-click the file icon to open it. If there are columns with
numerical data, excel will convert them to numbers and then will often
change them by truncating leading zeros, or converting them to
exponential values if they are many digits.

The standard solution for this is to open Excel and then initiate the
import wizard, but it would be nice if Excel could be set to
automatically recognize, by file type, that the import wizard should
be used.

I am reasonably capable with Excel myself and doubt that this option
exists, but the expert knowledge within this forum gives me hope that
if this can be done, someone here will know how.

Thanks very much,
TK
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Forcing Excel to Import .CSV data

Change the extension to .txt and open in Excel............the text
import wizard will appear.


Gord Dibben Microsoft Excel MVP

On Wed, 24 Aug 2011 07:38:50 -0700 (PDT), Cortez
wrote:

Does anyone know if it is possible to configure Excel to recognize
that when opening a .CSV file, the Import Wizard should be used?

We use a lot of .CSV files here, and many users have problems when
they double-click the file icon to open it. If there are columns with
numerical data, excel will convert them to numbers and then will often
change them by truncating leading zeros, or converting them to
exponential values if they are many digits.

The standard solution for this is to open Excel and then initiate the
import wizard, but it would be nice if Excel could be set to
automatically recognize, by file type, that the import wizard should
be used.

I am reasonably capable with Excel myself and doubt that this option
exists, but the expert knowledge within this forum gives me hope that
if this can be done, someone here will know how.

Thanks very much,
TK

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Forcing Excel to Import .CSV data

On 24/08/2011 19:45, Gord wrote:
Change the extension to .txt and open in Excel............the text
import wizard will appear.


Gord Dibben Microsoft Excel MVP

On Wed, 24 Aug 2011 07:38:50 -0700 (PDT),
wrote:

Does anyone know if it is possible to configure Excel to recognize
that when opening a .CSV file, the Import Wizard should be used?


The problem here is that your CSV files are malformed. Quotes around
numerical data held as strings have to be escaped into the CSV file.

We use a lot of .CSV files here, and many users have problems when
they double-click the file icon to open it. If there are columns with
numerical data, excel will convert them to numbers and then will often
change them by truncating leading zeros, or converting them to
exponential values if they are many digits.


If numeric data with many digits and leading zeroes is intended to stay
as strings it must be represented in a CSV file as """000001234"""

The standard solution for this is to open Excel and then initiate the
import wizard, but it would be nice if Excel could be set to
automatically recognize, by file type, that the import wizard should
be used.

I am reasonably capable with Excel myself and doubt that this option
exists, but the expert knowledge within this forum gives me hope that
if this can be done, someone here will know how.


I think the problem lies elsewhere. The files may have commas to delimit
the data fields but they are not correct CSV files.

Copy and paste these into a black worksheet and save as CSV
QWERTY 3.1
1234 "0001234"

You will find that saved as CSV it will come out as

QWERTY,3.1
1234,"""0001234"""

XL2007 gets this right when you use Save As .CSV so I would say the
problem lies here with whatever you are using to export malformed files
with a .CSV extension. Renaming them as .TXT files would get the wizard
but a better solution would be to fix the defective data source.

Regards,
Martin Brown
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
PLEASE!! How can I un-grey the 'Data-Import External Data-Import Data' option ??? kirkm[_6_] Excel Programming 13 August 8th 06 10:01 AM
Checking & Forcing Data Entry in Cells robertguy Excel Discussion (Misc queries) 1 January 23rd 06 06:01 PM
Forcing data into a cell daedalus1 Excel Worksheet Functions 0 December 12th 05 09:05 PM
Forcing data value in a cell Trying2Learn Excel Discussion (Misc queries) 2 November 14th 05 11:16 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"