텍스트 파일 (txt-Format)이 포함 된 큰 데이터 세트가 있습니다. textfiles이 형식의 데이터가 포함됩니다데이터 세트에서 일부 열을 제거하는 방법은 무엇입니까?
Name, Number, Timestamp, Sensordata1, Sensordata2, ... , Sensordata40
Name, Number, Timestamp, Sensordata1, Sensordata2, ... , Sensordata40
Name, Number, Timestamp, Sensordata1, Sensordata2, ... , Sensordata40
지금 나는 번호 및 모든 라인에서 타임 스탬프를 제거해야합니다.
순간에 내 코드 :
try{
// Open the file that is the first
// command line parameter
FileInputStream fstream = new FileInputStream("file.txt");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
}
//Close the input stream
in.close();
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
이 어떻게 자바에서이 작업을 수행 할 수 있습니다?
Somethin g는'String.split (',')'처럼 배열을 가져와 필요한 것을 제거합니다. – Furtiro