Parse log file in python

I have a log file that has lines that look like this: "1","2546857-23541","f_last","user","4:19 P.M.","11/02/2009","START","27","27","3","c2546857-23541","" Each line in the log as 12 double quote sections and the 7th double quote section in the string comes from where the user typed something into the chat window: "22","2546857-23541","f_last","john","4:38 P.M.","11/02/2009"," What's up","245","47","1","c2546857-23541","" This string also shows the issue I'm having; There are areas in the chat log where the text the user typed is on a new line in the log file instead of the same line like the first example. So basically I want the lines in the second example to look like the first example. I've tried using Find/Replace in N++ and I am able to find each "orphaned" line but I was unable to make it join the line above it. Then I thought of making a python file to automate it for me, but I'm kind of stuck about how to actually code it. ------------- Python errors out at this line running unutbu's code "1760","4746880-00129","bwhiteside","tom","11:47 A.M.","12/10/2009","I do not see ^"refresh your knowledge ^" on the screen","422","0","0","c4746871-00128",""

以上就是Parse log file in python的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » Notepad++

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏