gpt4 book ai didi

magento - csv 文件内容中的换行符

转载 作者:行者123 更新时间:2023-12-02 05:17:47 27 4
gpt4 key购买 nike

伙计们,我需要创建一个包含一些产品详细信息的非常简单的 csv 文件,以便将它们导入在线购物网站。每个产品都有 3 个属性:名称、描述和价格。

csv 文件看起来像这样:

产品1,产品描述,100产品 2,产品描述,100产品3,产品描述,100

我有两个问题:

1) 每个产品描述不止一行,类似

  This the product's description.
This is a cool feature.
This is another feature.
Product made in the US.

如何在 csv 文件中保留/添加此格式?

2)第二个问题,大多数产品描述都包含一个逗号“,”,例如: 这个产品很棒、可靠而且便宜。

如何在不破坏 csv 格式的情况下将这些逗号添加到描述中?

最后一个问题:有些产品描述超过 800 甚至 100 个字符。是否可以在 csv 的字段中添加那么多字符?

最佳答案

第一个问题的解决方法是使用 HTML <br/>标签而不是换行符。这就是我正在做的事情,至少在我找到更好的解决方案之前是这样。

所以你会改变:

This the product's description.
This is a cool feature.
This is another feature.
Product made in the US.

到:

This the product's description.<br/>This is a cool feature.<br/>This is another feature.<br/>Product made in the US.

至于第二个问题:在我的测试中,Magento 似乎对字段中的逗号没有任何问题。但是您始终可以更改 Magento 使用的分隔符。我通常使用制表符 (\t)。确保在 System > Import/Export > Dataflow-Profiles 中使用 Magento 的高级导入功能.

关于magento - csv 文件内容中的换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22174927/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com