在一列中包含多个逗号和引号,但不要将它们分开

时间:2019-06-26 18:53:38

标签: csv

我目前有.csv的片段,例如:

R111_Bellca_LiveContent_SHP,bell.ca,BCACXB-6903,Reflected_XSS_All_Clients,79,"*Reflected_XSS_All_Clients* issue exists @ *Views/Portal/RSX/Shared/Component_Styles/InfoBlock/Personalized_Recommendations_Title.cshtml*\r\n\r\n*Application:* R111_Bellca_LiveContent_SHP\r\n*Cx-Project:* R111_Bellca_LiveContent_SHP\r\n*Cx-Team:* CxServer\\Bell\\DCX\\Bell.ca\r\n*Severity:* High\r\n*CWE:* 79\r\n\r\n*Addition Info*\r\n----\r\n[Checkmarx|https://urlgoeshere/CxWebClient/ViewerMain.aspx?scanid=1000353&projectid=136&pathid=1102]\r\n[Mitre Details|https://cwe.mitre.org/data/definitions/79.html]\r\n[Training|https://cxa.codebashing.com/courses/]\r\n[Guidance|https://custodela.atlassian.net/wiki/spaces/AS/pages/79462432/Remediation+Guidance]\r\nLines: 28 29 \r\n\r\n----\r\nLine #28\r\n{code}\r\n <span class=\"hp-personal-title-name rsx-h3-xs rsx-font-black\">@Html.Raw(string.Format(Model.Title,firstName))</span>\r\n{code}\r\n----\r\nLine #29\r\n{code}\r\n <span class=\"hp-personal-title-main\">@Html.Raw(Model.Body)</span>\r\n{code}\r\n----\r\n",2-Major,https://cwe.mitre.org/data/definitions/79.html

我要关注的部分在这里:

"*Reflected_XSS_All_Clients* issue exists @ *Views/Portal/RSX/Shared/Component_Styles/InfoBlock/Personalized_Recommendations_Title.cshtml*\r\n\r\n*Application:* R111_Bellca_LiveContent_SHP\r\n*Cx-Project:* R111_Bellca_LiveContent_SHP\r\n*Cx-Team:* CxServer\\Bell\\DCX\\Bell.ca\r\n*Severity:* High\r\n*CWE:* 79\r\n\r\n*Addition Info*\r\n----\r\n[Checkmarx|https://urlgoeshere/CxWebClient/ViewerMain.aspx?scanid=1000353&projectid=136&pathid=1102]\r\n[Mitre Details|https://cwe.mitre.org/data/definitions/79.html]\r\n[Training|https://cxa.codebashing.com/courses/]\r\n[Guidance|https://custodela.atlassian.net/wiki/spaces/AS/pages/79462432/Remediation+Guidance]\r\nLines: 28 29 \r\n\r\n----\r\nLine #28\r\n{code}\r\n <span class=\"hp-personal-title-name rsx-h3-xs rsx-font-black\">@Html.Raw(string.Format(Model.Title,firstName))</span>\r\n{code}\r\n----\r\nLine #29\r\n{code}\r\n <span class=\"hp-personal-title-main\">@Html.Raw(Model.Body)</span>\r\n{code}\r\n----\r\n"

这是“描述”列的一部分,此字符串中的所有内容都必须位于1个单元格中。但是,您会看到有多个引号和逗号,并且它使字符串破裂

以上代码中断至

(1)
*Reflected_XSS_All_Clients* issue exists @ *Views/Portal/RSX/Shared/Component_Styles/InfoBlock/Personalized_Recommendations_Title.cshtml*\r\n\r\n*Application:* R111_Bellca_LiveContent_SHP\r\n*Cx-Project:* R111_Bellca_LiveContent_SHP\r\n*Cx-Team:* CxServer\\Bell\\DCX\\Bell.ca\r\n*Severity:* High\r\n*CWE:* 79\r\n\r\n*Addition Info*\r\n----\r\n[Checkmarx|https://cwypwa-368.bell.corp.bce.ca/CxWebClient/ViewerMain.aspx?scanid=1000353&projectid=136&pathid=1102]\r\n[Mitre Details|https://cwe.mitre.org/data/definitions/79.html]\r\n[Training|https://cxa.codebashing.com/courses/]\r\n[Guidance|https://custodela.atlassian.net/wiki/spaces/AS/pages/79462432/Remediation+Guidance]\r\nLines: 28 29 \r\n\r\n----\r\nLine #28\r\n{code}\r\n <span class=\hp-personal-title-name rsx-h3-xs rsx-font-black\">@Html.Raw(string.Format(Model.Title
(2)
firstName))</span>\r\n{code}\r\n----\r\nLine #29\r\n{code}\r\n <span class=\"hp-personal-title-main\">@Html.Raw(Model.Body)</span>\r\n{code}\r\n----\r\n"

此字符串的开头和结尾始终带有引号,但是问题在于字符串内也有引号,因此逗号被计为新列 有什么办法可以将它们全部结合起来?

0 个答案:

没有答案