[英]Exporting a database on the phone to a .csv that can be used on the computer
我想知道是否有人拥有允许我在应用程序中导出数据库并将其导出为.csv的代码。 希望这将使人们可以在Microsoft Office Excel中打开它并随时读取他们的数据。
只需执行SELECT * FROM [table]; (进入一些数据结构)
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
for(y=0; y<=[#rows]; y++){
for(x=0; x<=[#columns]; x++){
out.write([field]);
out.write(",");
}
out.write("\n");
}
out.close;
请尝试以下方法: 教程
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.