Results 1 to 3 of 3

Thread: Response.Write

  1. #1
    Join Date
    Dec 1969

    Default Response.Write

    I am using a response.write like <BR>response.write adata(i) & "," and converting it to a csv file.<BR>After converting to csv file the data which contains a "," in between displays in two different cells how can i rectify this<BR>thanks in advance

  2. #2
    Mike Shaffer Guest

    Default RE: Response.Write

    Data in a CSV is SUPPOSED to be split into separate cells, so I will assume that you are talking about when data is split which you do not want to be split (like lastname, firstname)...<BR><BR>To accomplish what you want, surround STRING data with double quotes, and leave numeric data without quotes (e.g. "Jones, David", 1, 2, "Smith, Bob")<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Response.Write

    If instr(adata(i), ",") &#062; 0 Then<BR>strToInsert = """" & adata(i) & """"<BR>Else<BR>strToInsert = adata(i)<BR>End If<BR>Response.Write strToInsert & ","<BR><BR>This will place double quote marks around each string that contains a comma. I believe this is the correct format for CSV files.<BR><BR>Good luck,<BR>Kurt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts