내 .txt 파일의 데이터를 Android 클래스의 ReaderClass로 읽으려는 경우 필드가 ";"로 구분됩니다..txt 파일 (안드로이드)에서 intput 스트림을 얻는 방법은 무엇입니까?
---- 여기 내 내 마지막 게시물의 솔루션입니다 :
public void cut()
{
try{
InputStream input =context.getResources().openRawResource(R.raw.textfile);
BufferedReader br = null;
br=new BufferedReader(new InputStreamReader(input,"iso-8859-1"));
String line = null;
while ((line = br.readLine()) != null) {
String[] decoupage= line.split(";");
String titre=decoupage[0];
String description=decoupage[1];
String reponse=decoupage[2];
String explication=decoupage[3];
String categorie=decoupage[4];
String etat=decoupage[5];
//test Logcat
Log.d("information ", " buffer");
Log.i("titre : ",titre);
Log.i("description : ",description);
Log.i("reponse : ",reponse);
Log.i("explication : ",explication);
Log.i("categorie : ",categorie);
Log.i("etat : ",etat);
}
in.close();
}catch (Exception e){
System.err.println("Error: " + e.getMessage());
System.err.println("\n File not found");
}
//end
}
이어야 당신이 질문을하기 전에 ** ** 것을 시도가! –
다른 질문에 댓글을 달았습니다 : ** http://stackoverflow.com/questions/11483992/how-to-find-my-db-file-in-sqlite ** 당신이 그것에 대답 할 수 있고 저를 도울 수 있습니까? 내 지식을 늘리시겠습니까? –