Notice
Recent Comments
Link
Tags
- mysql index 생성
- 디지털오션 클라우드서버 생성하기
- 라즈베리파이4
- Node.js express install
- express install
- 파이썬
- 디지털오션 드로플릿
- tzselect
- Python
- raspi-config
- java 숫자를 문자로 변환하기
- 우분투 시간설정
- npm버전확인
- 자바 한줄씩 읽기
- 우분투 node js 설치
- 클라우드서버 생성
- 디지털오션 서버생성하기
- C언어
- ubuntu node js install
- 자바 파일 한줄씩 읽기
- c file read
- 우분투 시간변경
- c언어 파일 읽기
- node js express install
- 파이썬 반복문
- ubuntu node js
- node js 버전확인
- Ubuntu timezone
- node 버전확인
- index 생성
Archives
- Today
- Total
호그래머
자바 텍스트파일 한줄씩 읽기 23.06.29 본문
728x90
1. 자바에스 텍스트파일 한줄씩 읽기
try{
File file = new File("C:\\Users\\HO\\Desktop\\test.txt");
FileReader filereader = new FileReader(file);
BufferedReader bufReader = new BufferedReader(filereader);
String line = "";
while((line = bufReader.readLine()) != null){
System.out.println(line);
}
bufReader.close();
}catch (FileNotFoundException e) {
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
test.txt파일 내용은
ABCDE12345abcd6789
가나다라마바사
728x90
'Java' 카테고리의 다른 글
자바 ArrayList 사용하기 23.06.29 (0) | 2023.06.29 |
---|---|
자바 숫자를 문자로 변환하기 23.06.29 (0) | 2023.06.29 |
자바 문자열 한글 체크하기 정규화 방법1(Java regex) 23.06.14 (0) | 2023.06.14 |
자바 문자열 공백 제거(Java String replace,trim) 23.06.13 (0) | 2023.06.13 |
자바 폴더 만들기(Java make directory) 21.01.04 (0) | 2021.01.05 |
Comments