从SD卡上的文件列中提取数据并放入android phon上的数组中

2024-04-25 13:01:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Android手机上的SD卡上有一个文本文件,在这个文件中,通过应用程序有多个列。 我想提取每一列数据并放入不同的-2数组。 由于我是新的应用程序开发,请帮助我或提供我的源代码。你知道吗

提前谢谢。你知道吗


Tags: 文件数据应用程序源代码数组sdandroid手机
1条回答
网友
1楼 · 发布于 2024-04-25 13:01:49

你要做的就是使用这样的东西:

try{
   InputStream flux=new FileInputStream("Your_File"); 
   InputStreamReader lecture=new InputStreamReader(flux);
   BufferedReader buff=new BufferedReader(lecture);
   String ligne;

   while ((ligne=buff.readLine())!=null){
       //Do the action that you want to do for each ligne.
       //If I well understand you need, split each ligne to give each columns.
   }
   buff.close(); 
   }        
   catch (Exception e){
   System.out.println(e.toString());
}

我希望你知道这正是你需要的。你知道吗

相关问题 更多 >