我正在尝试用 java 处理一个 csv 文件,但是在打印结果时,文本有太多空格。
使用此代码像上面的 img 一样打印:
FileInputStream fstream = new FileInputStream("prueba.csv");
// or using Scaner
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
System.out.println(strLine);
}
}
如果在例如 notapad++ 或 windows 记事本中打开文件,它看起来不错。我试图删除空格,但也没有成功:( 我能做什么?
相关分类