On Thu, 2 Nov 2000, George Vieira wrote:

> I have a script which runs in a CGI and outputs a CVS type file. The content
> type is for an Exel spreadsheet and it seems to load up on the clietn
> browser but Exel loads up the CVS data as 1 cell for line instead of
> splitting the cells into columns.
> 
> Have I got the wrong content type for IE or something?

The only way I have got this to work is to use a content type of


application/vnd.ms-excel


This will get excel to load the file on most versions. However I could
never get Excel to interpret CSV files without prompting for an import and
thus having to set delimiters manually etc. The way to overcome this is to
create a "DIF" or Document Interchange Format file. Excel can read these
okay, its a fomrmat the defines cells of data using vectors and tuples.

You can find a description of how to create dif files at the following.
http://www.wotsit.org/search.asp?s=database
They are just about as easy as CSV to create.

I usually give a choice of file format (text,CSV,excel) and output the
content-type and format of the file accordingly.

Rodos

P.S. Its really is a pain to get this to work (auto load into
excel) across lots of version of windows and eXcel. Avoid where possible.



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to