77

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?

Darko
  • 1,448
  • 4
  • 27
  • 44
  • 5
    such question should placed in Software Recommendation : http://softwarerecs.stackexchange.com/ , StackOverFlow isn't the right place – Jalal Mostafa Sep 24 '14 at 13:17

4 Answers4

99

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.

Big McLargeHuge
  • 14,841
  • 10
  • 80
  • 108
72

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

Alaa
  • 115
  • 12
Mike S.
  • 1,995
  • 13
  • 25
  • 9
    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. – Mike Williamson Apr 10 '18 at 22:04
42

My favorite:

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

No installation needed. Just drop the file.

Simon
  • 1,890
  • 19
  • 26
1

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)
emeryville
  • 332
  • 1
  • 4
  • 19
  • I found this tutorial on RSQLite helpful: https://blog.exploratory.io/accessing-sqlite-with-rsqlite-and-querying-with-dplyr-in-r-script-7eecf1e1b5b0 – windyvation Jan 10 '21 at 23:47