我创建了一个带有 printStream 对象的文件,如下所示。
PrintStream outPutOffice = new PrintStream(
new BufferedOutputStream(new FileOutputStream(inDir+"/Office.txt")));
outPutOffice.print(fValue + (findx < agtOffColCount ? "|" : ""));
现在我必须阅读它的内容并用“|”分隔它的标记因为我用“|”写了 token 分开了。我已经编写了如下所示的代码,它将正确读取行但不会用“|”分隔标记性格。
BufferedReader inPutAgent = new BufferedReader(
new InputStreamReader(new FileInputStream(inDir+"/Office.txt")));
String column=inPutAgent.readLine();
String []columnDetail = column.split("|");
columndetail 数组在每个索引中包含单个字符,而不是我希望在每个索引中包含单个标记。
问题是什么?
最佳答案
关于java - Java中的 token 解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1630092/