Parsing Character Stream

I am getting a continuous stream of characters which I have moved into a flat file in a single line. Now these characters are coming in below form. keepalivekeep_aliveenroll,10.213.17.4,0,12,594,4,5,METRO-A,1enroll,10.213.17.4,0,13,594,4,5,METRO-B,1clear,10.213.17.4,0,14,100010934,1323168443 What i want is to move messages coming between particular tags (`keep_alive`, `clear`, `enroll`, etc.) in different lines. For example output from above should be: keep_alive keep_alive enroll,10.213.17.4,0,12,594,4,5,METRO-A,1 enroll,10.213.17.4,0,13,594,4,5,METRO-B,1 clear,10.213.17.4,0,14,100010934,1323168443 What is the best way to do this in Java? What is noteworthy here is that file is getting continuous data and I need to do this continuously in some kind of loop.
A hundred ways to do it, all requiring programming. You might be able to employ "regular expressions" to do some of the work.

以上就是Parsing Character Stream的详细内容,更多请关注web前端其它相关文章!

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

评论 抢沙发

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

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

联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏