使用正则表达式python拆分文本文件

时间:2018-04-03 17:19:16

标签: python regex csv

我有一个CSV文件,其中每行包含一个ID号和一个注释:

10476195,"Very nice, thanks. I'll do more extensive research on that. :-)
"
10221912,"Why are you passing in encoded HTML into the model?  If ng-bind-html-unsafe
will just pass through the string to the browser.  So if you give it
`<br>` then this is what the browser will get - and so will print
<br> on the screen. If you want a line break then put ""<br>"" into the
string.
"

"
10237382,"I have some encoded HTML... going to write a directive myself then. Thank you. This issue can be closed I guess
"
10237600,"Great.  Here is a naive function for doing it: http://pranavrajyaguru.wordpress.com/2010/06/03/decode-html-through-javascript/.
Closing for now.
"

我需要将记录拆分为ID和注释。我尝试使用像\n"\n\d{0,10}这样的正则表达式,但效果不好。

0 个答案:

没有答案