我需要使用Realbasic将CSV文件加载到sqlite DB中。按照this教程中的说明执行此操作没有问题。
你能帮我用RealBasic做到这一点吗?
我正在尝试使用Shell类:
Dim folder As FolderItem = GetFolderItem("")
Dim sh As Shell = new Shell
sh.Mode = 2
If Not sh.IsRunning Then
sh.Execute "sh"
End If
sh.Write( "cd " + folder.ShellPath )
sh.Write( "sqlite3 " + App.GetDatabaseName() + ".sqlite" )
sh.Write( ".separator "",""")
sh.Write( ".import " + FileName + " " + TableName )PS:在Shell中,执行过程中没有错误消息。但是数据不会导入到表中。
如何修复它?
谢谢!
发布于 2012-04-20 05:38:18
尝试使用WriteLine而不是Write来发送命令。
sh.WriteLine( "cd " + folder.ShellPath )
sh.WriteLine( "sqlite3 " + App.GetDatabaseName() + ".sqlite" )
sh.WriteLine( ".separator "",""")
sh.WriteLine( ".import " + FileName + " " + TableName )https://stackoverflow.com/questions/10198313
复制相似问题