简体   繁体   中英

Can't export SQL results as excel file when commas are in the description column text

I am seeing an issue here. I have a sql database with over 10,000 records. There is a description column that contains user input from our support website. Some users put commas into their description for grammar purposes. When I go to export my sql results as a excel file, the commas in the user description text mess up the arrangement of the file. I need to export as what's in the SQL cells and not every time it sees a comma. Please help?

I believe if you wrap each output field in quotes, Excel should know to treat that as one field.

I hope this helps.

Thank you, I also did a replace within the database and replaced all the commas with a space, and then replaced all the tabs and line breaks with a space as well. The new line delimiter was making excel think it was a new cell. I opened the excel file in notepad++ to see all of the LF's and CRLF's and then just searched+replaced the ascii sequence of the two in SQL with a space. LF's, commas, and tabs, are all non important characters to preserve. Thanks again. -Chris

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM