我正在使用带有 GWT 框架的 java 在我的应用程序上读取一个 csv 文件。有没有办法让我暂时关闭缓冲的阅读器?
我的意思是当我找到我正在寻找的特定行时,有没有办法让我停止读取 csv 文件?
bufferedReader.close() 会导致错误。它在服务器上显示错误,因为流已关闭。bufferedReader.reset() 不起作用,或者它说它不受支持。
请帮忙。提前致谢。
编辑。
while ((line = br.readLine()) != accountColumn ) {
if (line.equals(accountColumn)) {
System.out.println(line);
checker = true;
String[] columns = line.split(cvsSplitBy);
int totalColumns = columns.length;
int col = 0;
while (col < totalColumns) {
log.append(columns[col] + "\n");
col++;
}
JOptionPane.showMessageDialog(frame,"SAME COLUMNS DETECTED, READY FOR UPLOAD");
输出。
LEDGER,EXTRACT_NAME,COUNTRY,ENTITY,TAX_CATEGORY,TAX_SUB_CATEGORY,TAX_ACCOUNT_TYPE,TAX_ACCOUNT,ACCUNT_TYPE,TAX_DRIVER,USE_FLAG,INPUT_ID,INPUT_NAME,DEL_FLAG
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
1,456,465,46,5456,456,4,45,5656456,56,564,6546,654,6564
它找到我正在寻找的特定行但继续阅读其余部分