Skip to content

Merges separate sqlite databases (that follows the AppDataCollect app's schema) into (1) master sqlite database file. Exports farmland data into a CSV file.

Notifications You must be signed in to change notification settings

ciatph/sqlitemerge

Repository files navigation

sqlitemerge

Merges separate sqlite databases (that follows the AppDataCollect app's schema) into (1) master sqlite database file. See /databases/appdatacollect.db for sample sqlite database that follows the format.

Exports the merged farmland data into a CSV file.

PREREQUISITES

  • PC using Windows OS
  • For fast and optimal data processing, please run the windows batch scripts in an SSD.
  • GitBash installed and available globally in your Windows PC.
  • AppDataCollect.db's must be available in the /databases directory.
    See the section Sqlite Database Files, or run externals.bat.
  • the files: commands.txt, commands_tables.txt and schema_sqlite.sql must be available in the /settings directory

USAGE

  1. Run init.bat (1) time only, if there is no maindb.db file yet
  2. Grab a copy of any of the (5) CIAT devices' AppDataCollect.db.
    See the section Sqlite Database Files, or run externals.bat.
  3. Create sub directories inside /databases numbered 00, 01...0N. Put an AppDataCollect.db inside each. Sample directory and database file hierarchy:
    /databases ->
    00/AppDataCollect.db
    01/AppDataCollect.db
    ...
    05/AppDataCollect.db
    (Skip this step if you are able to run externals.bat from Step no. #2.)
  4. Run merge.bat.
  5. Run csv.bat to export consolidated farmland data from all sqlite databases.
    Output: export_csv.csv

ALTERNATIVE USAGE

  1. Run import.bat. Enter the filename of the sqlite database that you've copied from any of the device.
  2. Run only import.bat for succeeding imports from other AppDataCollect.db's.
  3. Run csv.bat to export consolidated farmland data from all sqlite databases.
    Output: export_csv.csv

Sqlite Database Files

You can request for access to the (5) CIAT devices' sqlite databases, which are regularly updated here: https://ciatph@bitbucket.org/ciatph/data.git

Date Created: 20180323
Date Modified: 20180731

About

Merges separate sqlite databases (that follows the AppDataCollect app's schema) into (1) master sqlite database file. Exports farmland data into a CSV file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published