嗨,对不起。查找字符串并在java文本文件中追加文本
这是一个文本文件
[TESTRESULT]
testdate=5/16/2013
testtime=20:03:00
operator=Jacob Poulsen
test_no=62495
axles_tested=2
[AXLE1RESULT]
fric_l=38
fric_r=51
p0_l=0
p0_r=0
fl=280
fr=300
所以我觉得问题的 首先找到字符串例如:
第二附加文本[AXLE1RESULT]
喜欢这个
[TESTRESULT]
testdate=5/16/2013
testtime=20:03:00
operator=Jacob Poulsen
test_no=62495
axles_tested=2
[SomeText]
Something=0
Something=0
Something=0
[AXLE1RESULT]
fric_l=38
fric_r=51
p0_l=0
p0_r=0
fl=280
fr=300
之前,我应该怎么做???
我不能完全告诉你的要求;但这些文件被格式化为Windows INI文件。也许http://stackoverflow.com/questions/190629/what-is-the-easiest-way-to-parse-an-ini-file-in-java将有所帮助(ini4j可以读取,解析和编写它们,并且会让你轻松修改值)。 –