Wrox Programmer Forums
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 2nd, 2005, 06:07 AM
vc1 vc1 is offline
Registered User
Join Date: Feb 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Writing data to a CSV file

Hi All,

I want to send some data from my asp page into a spreadsheet.Fot that I am doing

Response.AddHeader "Content-Disposition", "filename=mydata.csv;"

But the problem I am facing is that, in one of the fields which I want to send to spreadsheet contain commas.Using comma as delimiter creates problem as it splits in between.How can I change the delimiter for the file within an asp page.

Or is there any other solution.

Please help.

Old September 28th, 2005, 08:26 AM
Authorized User
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts

in my codes, I use Replace to check for ',' and replace it with ';'.

something like this,
strLine = strLine & Replace(Item,",",";") & ","
where Item is the record from the recordset.

strLine is then added to CSV file by Scripting.FileSystemObject's WriteLine.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing data from a CSV file? kr33 SQL Server 2000 26 January 3rd, 2007 02:38 AM
Import data in CSV file itHighway Classic ASP Professional 0 September 15th, 2006 10:29 AM
Importing data from CSV file g_vamsi_krish ASP.NET 1.0 and 1.1 Basics 2 May 23rd, 2006 01:29 AM
Transfering data from csv file to data base g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 May 16th, 2006 11:58 PM
Writing data to a CSV file vc1 VBScript 1 March 10th, 2005 04:32 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.