Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 77
Default Excel CSV Files; Creating Of

Hello,

I have created a small Excel file that I wish to be saved as a CSV.

Question: do I have to put " marks around the beginning, and end, of
the text in each cell, or does Excel automatically do what is required
for CSV when I tell it to Save As a CSV ?

I did not put any " marks around any text, and when I opened it up in
Notepad++, there were a single set of double quotes (e.g., "Bob") marks
around the text.

Is the initial Excel file I created without any " text marks
a "true" CSV ? Or,...?

Working with, and creating, a CSV seems a bit confusing, at least to me.
I did read many of the CSV articles via a Google, but still not too clear.

Any clarifications on what is exactly required when creating in Excel
would be most appreciated.

Thanks,
Bob
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Excel CSV Files; Creating Of

Hi Bob,

Am Tue, 19 Nov 2013 14:27:40 -0500 schrieb Bob:

I have created a small Excel file that I wish to be saved as a CSV.

Question: do I have to put " marks around the beginning, and end, of
the text in each cell, or does Excel automatically do what is required
for CSV when I tell it to Save As a CSV ?


there is no need to put quote marks around the text. If your separator
is into the text of a cell Excel put quote marks around the text of that
cell automatically.


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default Excel CSV Files; Creating Of

Adding to Claus' reply...

CSV stands for Comma Separated Values. That precludes, then, that you
values should not contain commas. But if they do happen to contain
commas then Excel will wrap those values in quotes to indicate the
contained comma is not a delimiter.

IMO, it's best to replace contained commas with another character when
creating CSVs using SaveAs. Preferably, I'd dump the data into an array
and write that to a text file with a .csv extension (after replacing
contained commas, OR using a different delimiter so the contained comma
issue is mute)! This avoids having to deal with (or code for) Excel's
built-in export/import issues because it allows using standard VB[A]
I/O functions.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Excel CSV Files; Creating Of

"Bob" wrote:
I have created a small Excel file that I wish to be saved as a CSV.
Question: do I have to put " marks around the beginning, and end,
of the text in each cell, or does Excel automatically do what is
required for CSV when I tell it to Save As a CSV ?


Excel puts double-quotes around text where Excel deems it is necessary.
Generally, that is text that contains the CSV separator (usually comma) and
text that contains double-quotes. However, there might be other situations.


"Bob" wrote:
I did not put any " marks around any text, and when I opened it
up in Notepad++, there were a single set of double quotes
(e.g., "Bob") marks around the text.


That is odd. Excel does not double-quote simple text like Bob when I try
it, even if the cell is formatted as Text.


"Bob" wrote:
Is the initial Excel file I created without any " text marks
a "true" CSV ? Or,...?


Yes, as long as columnar data is separated using commas (or the List
Separator configured in the Regional and Language Options control panel).


"Bob" wrote:
Working with, and creating, a CSV seems a bit confusing, at least to me.
I did read many of the CSV articles via a Google, but still not too clear.


Understandably so.

Creating (saving to) CSV files should not be confusing. But getting Excel
to interpret (read) CSV files as you intended might be tricky.

In particular, even if you surround text with double-quotes, Excel still
might not interpret the data as text. For example, "000123" is interpreted
as a number and the cell is formatted as General. So the leading zeros will
not appear in Excel by default, despite the double-quotes in the CSV file.

Sometimes, we must import the CSV file instead of opening it directly using
Excel. By "import", I mean: use the Get External Data / From Text
operation. That allows us to specify a column of data to be formatted as
Text (or Date), not General.

However, even that might not be sufficient if the data to be treated as text
is not columnar, and Excel insists on interpreting it as numeric.

Other applications might interpret (read) the CSV file differently, always
treating the double-quoted data as text.

There are no standards for reading a CSV file. Only for writing it (RFC
4180).

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
CREATING PDF FILES FROM EXCEL FILES NSNR Excel Discussion (Misc queries) 2 January 31st 08 06:39 AM
Excel Creating strange files Chad Guiney Setting up and Configuration of Excel 1 February 27th 07 02:31 PM
Creating PDF files from Excel. Chaplain Doug Excel Discussion (Misc queries) 2 December 16th 04 10:42 PM
Creating excel files using VBA sameerce[_23_] Excel Programming 1 October 14th 04 09:21 PM
Creating excel backup files Andrew Fekete Excel Programming 1 October 14th 03 11:35 PM


All times are GMT +1. The time now is 04:59 PM.

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"