How to open .SQLite files
Asked Answered
G

4

92

I'm trying to open a .sqlite file on Windows, but I don't know how to. Do you know a good program for it?

It contains data for statistical analysis, but I prefer having a .txt file.

I also have a .spatialite file. Can you help me?

Gaal answered 24/9, 2014 at 11:24 Comment(1)
such question should placed in Software Recommendation : softwarerecs.stackexchange.com , StackOverFlow isn't the right placeGlare
E
4

I would suggest using R and the package RSQLite

#install.packages("RSQLite") #perhaps needed
library("RSQLite")

# connect to the sqlite file
sqlite    <- dbDriver("SQLite")
exampledb <- dbConnect(sqlite,"database.sqlite")

dbListTables(exampledb)
Eversion answered 15/1, 2017 at 20:49 Comment(1)
I found this tutorial on RSQLite helpful: blog.exploratory.io/…Cocklebur
P
123

If you just want to see what's in the database without installing anything extra, you might already have SQLite CLI on your system. To check, open a command prompt and try:

sqlite3 database.sqlite

Replace database.sqlite with your database file. Then, if the database is small enough, you can view the entire contents with:

sqlite> .dump

Or you can list the tables:

sqlite> .tables

Regular SQL works here as well:

sqlite> select * from some_table;

Replace some_table as appropriate.

Payday answered 11/3, 2019 at 15:41 Comment(5)
This should be an accepted answer, no need to install heavy weight packagesMonkey
My Windows 10 did not recognize sqlite3 as a command.Riflery
@Riflery You'll have to install the sqlite cli first.Mares
get it from here, use command prompt from the same folder you extracted it, sqlite.org/2023/sqlite-dll-win64-x64-3410200.zipCentrosymmetric
Or, for the latest, sqlite.org/download.htmlJeanettajeanette
P
80

SQLite is database engine, .sqlite or .db should be a database. If you don't need to program anything, you can use a GUI like sqlitebrowser or anything like that to view the database contents.

There is also spatialite, https://www.gaia-gis.it/fossil/spatialite_gui/index

Putumayo answered 24/9, 2014 at 11:28 Comment(1)
I think this is closer to the "right" answer. I suspect a means to access the data via an API through R or another language is not as broadly helpful, even if it helped the OP.Rubidium
G
51

My favorite:

https://inloop.github.io/sqlite-viewer/

No installation needed. Just drop the file.

Goodsell answered 28/11, 2019 at 17:14 Comment(1)
This is so simple, and no callbacks to the server. You can save the page for use offline if need be.Riflery
E
4

I would suggest using R and the package RSQLite

#install.packages("RSQLite") #perhaps needed
library("RSQLite")

# connect to the sqlite file
sqlite    <- dbDriver("SQLite")
exampledb <- dbConnect(sqlite,"database.sqlite")

dbListTables(exampledb)
Eversion answered 15/1, 2017 at 20:49 Comment(1)
I found this tutorial on RSQLite helpful: blog.exploratory.io/…Cocklebur

© 2022 - 2024 — McMap. All rights reserved.