View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Marvin P. Winterbottom Marvin P. Winterbottom is offline
external usenet poster
 
Posts: 34
Default Newlines in csv files

You have to somehow get rid of the carriage returns in the textbox, excel is
seeing them as end-of-record even if they are in the quotes.
In that text field, can you replace chr(13) with a slash "/" or something?

"tshad" wrote:

I have a problem with a .csv file I am trying to read into an excel sheet.

I have all of my fields surrounded by quotes to prevent commas inside a text
field from being mistaken for a field separator. The problem is that some
of my fields have newlines in them as they are taken from a multiline
textbox on my web page and put into my sql table. I then read the sql table
and write out the table in .csv format. But I think the newlines are being
mistaken for line separators - even if within quotes.

If I have a text with 3 new lines, they will end up on 4 lines of my Excel
sheet.

Why is that? Is there a way around this problem?

Thanks,

Tom