用Java编写文件解析器的技巧? [英] Tips for writing a file parser in Java?
本文介绍了用Java编写文件解析器的技巧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
编辑:我主要解析以逗号分隔的值,模糊地引起了我的注意。
解释块CSV是这里的主要问题。
Interpreting the blocks of CSV are the main question here.
我知道如何将文件读成像 String []
和 String
的一些基本功能,但我不认为使用像这样的方法包含()
并分析所有内容逐字符将起作用。
I know how to read the file into something like a String[]
and some of the basic features of String
, but I don't think using methods like contains()
and analyzing everything character by character will work.
我可以通过哪些方式更聪明地做到这一点?
What are some ways I can do this in a smarter way?
示例一行:
-barfoob:boobs,foob,foo bar
推荐答案
This and digging through wikipedia for related articles will probably suffice.
这篇关于用Java编写文件解析器的技巧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文