CSV 和 html 作为列之一

CSV and html as one of the column

创建了 csv 但 FileHelpers 库(但不要认为它在这里很重要。但是我的 csv 是逗号分隔文件。我总是在每个字段之间加上引号。在我的最后一列中,我正在提取 html 代码. 然而,当尝试在 excel 中打开 csv 时,我的 html 字段列数据的一部分将转到第一列,而来自 html 的一些数据被放置在 excel 中的 B 列中可以有人在这里帮忙,告诉我哪里出了问题吗?这是确切的例子:

Sample csv

Artikelnummer,Vater,Variation1,Variationswert1,Variation2,Variationswert2,Variation3,Variationswert3,Barcode,Artikelname,Artikelname2,Hersteller,KategorieLevel1,KategorieLevel2,KategorieLevel3,KategorieLevel4,KategorieLevel5,Merkmalname1,Merkmalwertname1,Merkmalname2,Merkmalwertname2,Merkmalname3,Merkmalwertname3,Html
"29.1023.1","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>

<b style=""font-size:22pt;"">Überblick:
</b>
<br>

</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
    <tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.1
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Zur auswahl
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
        </td>
    </tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
    <tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
        </td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
        </td>
    </tr>
</table><div style=""clear:both !important;"">

</div>


<br>

</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
    <li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
    <li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
    <li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
    <li style=""font-size:12pt;"">NF</li>
</ul>

<br>

</br>
"
"29.1023.2","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>

<b style=""font-size:22pt;"">Überblick:
</b>
<br>

</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
    <tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.2
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">WeiB
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
        </td>
    </tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
    <tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
        </td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
        </td>
    </tr>
</table><div style=""clear:both !important;"">

</div>


<br>

</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
    <li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
    <li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
    <li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
    <li style=""font-size:12pt;"">NF</li>
</ul>

<br>

</br>
"
"29.1023.3","","Height","WeiB","","","","","","","","","","Kategoria_A","Podkategoria_A","","co tu?","Height","WeiB","","","","","<meta http-equiv=""content-type"" content=""application/xhtml+xml; charset=UTF-8""/>

<b style=""font-size:22pt;"">Überblick:
</b>
<br>

</br>
<table cellpadding=""10"" cellspacing=""10"" align=""left"" style=""font-size:12pt;table-layout:fixed;width:30%;"">
    <tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Marke:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">JUSThome
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Serie:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">blabla
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Artikel-Nr.:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">29.1023.3
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Height:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">WeiB
        </td>
    </tr><tr>
        <td width=""40%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Material:</td><td width=""60%"" border=""3"" style=""text-align:left;padding-left:20px;"">Material_B1
        </td>
    </tr>
</table><table cellpadding=""10"" cellspacing=""10"" align=""right"" style=""font-size:12pt;table-layout:fixed;width:70%;"">
    <tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Abmessungen:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;""></td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Höhe:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">1,00 cm
        </td>
    </tr><tr>
        <td width=""20%"" border=""3"" style=""vertical-align:top;text-align:left;padding-left:20px;color:white;background-color: #b4b4b4"">Breite:</td><td width=""80%"" border=""3"" style=""text-align:left;padding-left:20px;"">2,00 cm
        </td>
    </tr>
</table><div style=""clear:both !important;"">

</div>


<br>

</br>
<b style=""font-size:22pt;"">Abmessungen im Detail:
</b>
<ul>
    <li style=""font-size:12pt;"">Höhe: 1,00 cm</li><li style=""font-size:12pt;"">Breite: 2,00 cm</li>
</ul>
<ul>
    <li style=""font-size:12pt;"">Kot : kott </li><li style=""font-size:12pt;"">Swinia : swiania </li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_A:
</b>
<ul>
    <li style=""font-size:12pt;"">WK</li><li style=""font-size:12pt;"">ZW</li>
</ul>

<br>

</br>
<b style=""font-size:22pt;"">Sekcja_Design:
</b>
<ul>
    <li style=""font-size:12pt;"">NF</li>
</ul>

<br>

</br>
"

这是 excel 中的样子。每个数据都正确放置,没有 html 部分:

这就是我在 excel 中打开它时的样子,没有任何修改(在文本到列选项之前):

由于这在技术上不是一个答案,所以我打算将其作为对您问题的评论。但是,我的 "reputation" 不够高,无法发表评论。具有讽刺意味的是,我可以回答问题,但不能对它们发表评论。无论如何...我将您的示例复制并粘贴到我的 Mac 书中并将其保存为 CSV。它在 Excel 打开对我来说很好。我有一种感觉,这与 Mac 与 PC 处理换行符的方式有关。希望我能提供更多帮助,但由于它对我来说打开得很好,我无法真正解决问题。

Screenshot

Screenshot

它在 Excel 2013 年运行良好。请查看屏幕截图。我只是将内容保存在 .csv 文件中并在 excel 中打开。