如何使用CSV列逗号 [英] how to use comma in csv columns
问题描述
可能重复:结果
的在文件
块引用>
<用逗号处理p >我们出口批量数据导入CSV文件为我们的项目之一。因此,在这种情况下,我们有导出像A,B,C,D,所有必须保持在一列中的值。但逗号将它们分开到不同的列。
如果我们在出口或textarea的编辑器中输入一些值,其中包含像\r\\\
字符将被导出为像在CSV分开行。我怎么能解决这个问题?
解决方案来处理这种情况的最常见的方法是使用的,周围的领域,而且取决于谁正在消费的文件也可以在许多方面进行处理。您可以划定逗号,你可以改变逗号一个特殊值,或使用不同的分隔符,但最命令
Possible Duplicate:
Dealing with commas in a CSV fileWe are exporting a bulk data into a csv file for one of our projects. So in this case we have to export values like a,b,c,d which all have to be remain in one column. But the comma will separate them to different columns.
Like if we export some values entered in textarea or editor which contains character like \r\n will be exported as separate rows in csv. How can i solve this problem??
解决方案The most common way to handle this is to use "" around the field, but depending on who is consuming your files it can be handled in a number of ways. You can delimit the commas, you can change the commas to a special value or use a different delimiter, but the most command
这篇关于如何使用CSV列逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!