2009. 11. 15. 19:56

BufferedReader in = new BufferedReader(new FileReader("c:\\log.txt"));
  String line=in.readLine();
  
  StringTokenizer st = new StringTokenizer(line,"/");
  
  while(st.hasMoreTokens()){
  di = new DateInfo();
  di.setYear(Integer.parseInt(st.nextToken()));
  di.setMonth(Integer.parseInt(st.nextToken()));
  di.setDay(Integer.parseInt(st.nextToken()));
  di.setHour(Integer.parseInt(st.nextToken()));
  di.setMinute(Integer.parseInt(st.nextToken()));
  di.setTotalHour(Integer.parseInt(st.nextToken()));
  di.setTotalMinute(Integer.parseInt(st.nextToken()));
  
  vc.add(di);
  }

'JAVA 6.0 > Fundamentals' 카테고리의 다른 글

replaceAll로 공백 제거하기  (0) 2010.07.26
BufferedWriter 파일에 데이터 삽입  (0) 2009.11.15
Posted by TIMEC