Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Q
quotemarks-ios
  • Project overview
    • Project overview
    • Details
    • Activity
  • Requirements
    • Requirements
    • List
  • Analytics
    • Analytics
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
Collapse sidebar
  • Quotemarks
  • quotemarks-ios
  • Wiki
  • Manually Importing CSV

Last edited by Slythfox Nov 08, 2019
Page history

Manually Importing CSV

How Can I Create a Data Package from Existing CSV Data?

Is Quotemark's direct CSV import feature not enough for you? If you are comfortable working with JSON and CSV you can create your own package to import. Quotemarks supports a variation of the Tabular Data Package format which is essentially a folder with some CSV files containing your data and an index that glues it all together.

We recommend that you back up any existing data you have in the app first, and then start with a fresh app install.

  1. Create a new folder and rename it to add .tabular at the end of the folder name.
  2. Inside this folder create a new file called datapackage.json using a plain text editor. This file describes where to find your CSV, the format of the data (called a "schema"), and how its encoded (the CSV "dialect"). Save the following text in this file:
{
  "resources" : [
    {
      "name" : "Quotation",
      "format" : "csv",
      "path" : [
        "quotation.csv"
      ],
      "schema" : {
        "fields" : [
          {
            "name" : "_id",
            "format" : "uuid",
            "type" : "string",
            "constraints" : {
              "required" : true,
              "unique" : true
            }
          },
          {
            "type" : "string",
            "name" : "quote"
          },
          {
            "type" : "string",
            "name" : "note"
          },
          {
            "type" : "string",
            "name" : "source"
          },
          {
            "type" : "string",
            "name" : "author"
          },
          {
            "type" : "datetime",
            "name" : "dateAdded"
          },
          {
            "type" : "array",
            "name" : "tags"
          },
          {
            "type" : "array",
            "name" : "events"
          }
        ],
        "primaryKey" : [
          "_id"
        ],
        "foreignKeys" : [],
        "missingValues" : [
          ""
        ]
      },
      "mediatype" : "text\/csv",
      "encoding" : "UTF-8",
      "dialect" : {
        "nullSequence" : "",
        "delimiter" : ",",
        "caseSensitiveHeader" : true,
        "lineTerminator" : "\r\n",
        "skipInitialSpace" : false,
        "csvddfVersion" : "1.2",
        "escapeChar" : "",
        "quoteChar" : "\"",
        "doubleQuote" : true,
        "header" : true
      },
      "profile" : "tabular-data-resource"
    }
  ],
  "profile" : "tabular-data-package"
}
  1. Inside the same folder, save a CSV file called quotation.csv with your quotations including this header as the first line: "_id","quote","note","source","author","dateAdded","tags","events". In each row leave the fields _id, tags, and events blank. Order matters. A spreadsheet editor may help you here.
  2. If necessary, update the dialect object in to reflect the formatting of your CSV file. See CSV Dialect for more about this.
Clone repository
  • About the Backup Format
  • Home
  • Importing CSV
  • Manually Importing CSV
  • Retrieving and Restoring Backups