-5
假設我有以下文本文件,如何讀取由Java中的2個空行分隔的每行塊?(Java)如何通過塊讀取文本文件塊
謝謝!
Reference Type: Journal Article
Record Number: 153
Author: Yang, W. and Kang, J.
Year: 2005
Title: Acoustic comfort evaluation in urban open public spaces
Journal: Applied Acoustics
Volume: 66
Issue: 2
Pages: 211-229
Short Title: Acoustic comfort evaluation in urban open public spaces
ISSN: 0003682X
DOI: 10.1016/j.apacoust.2004.07.011
'File' Attachments: internal-pdf://0633242026/Acoustic comfort evaluation in urban open public spaces.pdf
Reference Type: Thesis
Record Number: 3318
Author: Wienold, Jan
Year: 2009
Title: Daylight glare in offices
University: Fraunhofer Institute for Solar Energy Systems ISE
Thesis Type: PhD Dissertation
Short Title: Daylight glare in offices
URL: http://publica.fraunhofer.de/eprints/urn:nbn:de:0011-n-1414579.pdf
'File' Attachments: internal-pdf://2172014641/Daylight glare in offices.pdf
看來,在這個論壇回答問題是相當挑剔的......我認爲它真的沒有必要。不過,這是我經過處理,建立在Java上一個編程環境嘗試:每個塊的
import java.util.*;
String fileName = "";
String line;
BufferedReader br;
void setup(){
fileName = "My_EndNote_Library_2014-07-04.txt";
br = createReader(fileName);
}
void draw(){
try {
line = br.readLine();
println(line);
println();
} catch (IOException e) {
e.printStackTrace();
line = null;
}
if (line == null) {
// Stop reading because of an error or file is empty
noLoop();
}
}
非常感謝你,sujithvm! – oat
@oat樂意幫忙:) – sujithvm