'행정자치부'에 해당되는 글 1건

  1. 2016.05.31 [Java] 우편번호 DB text 파일 읽기.

[Java] 우편번호 DB text 파일 읽기.

ITWeb/개발일반 2016. 5. 31. 16:33

행자부나 우체국에서 도로명 주소를 제공하고 있습니다.

이 데이터들이 ISO-8859-1 로 인코딩 되어 있기 때문에 파일을 읽을 때 인코딩 타입을 잘 맞춰서 읽으셔야 한글 처리를 하실 수 있습니다.


아래는 행자부와 우체국의 도로명 주소 DB 제공 링크 입니다.


[행정자치부]

http://www.juso.go.kr/support/AddressBuild.do?menu=adrchg


[우체국]

http://www.epost.go.kr/search/zipcode/areacdAddressDown.jsp



아래는 prototype code 입니다.


[Read jibun_busan.txt]

String src = "/dump/address/jibun/201604/jibun_busan.txt";
BufferedReader br;
String line;

try {
br = new BufferedReader(
new InputStreamReader(
new FileInputStream(src), "ISO-8859-1"));

while ((line = br.readLine()) != null) {
LOG.debug("{}", new String(line.getBytes("ISO-8859-1"), "MS949"));
}

br.close();
} catch (IOException e) {
e.printStackTrace();
}


: