unicode CSV files

G

Guest

I need to write unicode csv files from a dotnet application to be opened in
Excel.
I can write the files OK by setting
Response.ContentEncoding = System.Text.Encoding.Unicode
but when I try & open them in Excel it says 'The file is not in a
recognizable format'.
I haven't been able to see any settings to change the acceptable formats.
Anyone any ideas as to how this can be done?

Thanks,

John
 
M

Michel Pierron

Hi John,
Do you have the same problem if you to try to open this file with Word ?
MP
 
G

Guest

Hi Michel,

Opening in Word it prompts you to select the required encoding. Once Unicode
is selected it opens OK.
Excel doesn't have the same prompt

John
 
M

Michel Pierron

Re John,
If you rename your file with the txt extension and that you open it with
Excel, do you have the same error ?
MP
 
M

Michel Pierron

Re John,
Which version of Excel do you have ?
The csv files are text files. With Excel 2003, if I separately create a
unicode (UTF-16 or UTF-8) txt file with the comma, semicolon or tabulator
like separator and that records it with the csv extension, when I open this
file with Excel, I have the dialogbox allowing choice for the type of data
(delimited or not) and the separator.

MP
 
G

Guest

I'm using Excel 2003 as well.
What I'm getting is that the dotnet application writes the csv file but when
the file is double-clicked Excel says 'The file is not in recognizable
format' & doesn't give any option to open it other than all the data in a
single cell. I don't really want the end user to have to go through the
import data routine for every file that gets created.

John
 
N

NickHK

John,
What is the format of the output then ?
Seems Excel will open a Unicode file if Tab separated with a .txt extension
though.

NickHK
 
M

Michel Pierron

Hi John,

I made some tests and if you don't really want the end user to have to go
through the import data routine for every file that gets created, your csv
file can be only with format ANSI or UTF-8.
Import & Export of a CSV file depends on the Regional & Language Options in
the Windows Control Panel (for English (United States) the separator is the
comma).

Regards,
MP
 

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