弦を分割したい...最初の5回だけ唾を吐き出し、その後...1つの弦で休む
私はこれを試しました
public class FileRead
{
public static void main(String[] args) throws IOException
{
StringBuffer strBuff = new StringBuffer();
String str = null;
File file = new File("D:\\wokies\\5_dataset.txt");
try {
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
System.out.println(line);
String [] splitSt =line.split(" ");
System.out.println("split happing");
for (int i = 0 ; i < splitSt.length ; i++)
{
System.out.println(splitSt[i]);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}