Data Import

Tasks can be imported from files with this command:

% task import file
A variety of different file types are recognized by task, namely:
  • Tasks exported from task prior to version 1.5.0.
  • Tasks exported from task version 1.5.0 and later. The file format changed with 1.5.0.
  • todo.sh files.
  • CSV files with a variety of recognized column names.
  • Plain text files, with one task listed per line.
  • Task command line format.

Task makes a good effort to determine which of these formats a file is. It does this by reading the file, and looking for familiar patterns. For example, the easiest files to recognize are those exported from task itself, because they all have a header line that comes in only three variations. Other formats are a little harder to identify, but they all have their own identifying characteristics.

The most complex import is when a CSV file is recognized. Task needs a field header line in order to map columns to task data items. For example, the if the following file is imported:

number,status,task
1,pending,task one
2,pending,task two

Task will map the "number" field to task's "id" field, etc, based on name. Task has a list of synonyms that it uses to map fields, but you can specify your own override with any of the following configuration variables:

  • import.synonym.id
  • import.synonym.uuid
  • import.synonym.status
  • import.synonym.tags
  • import.synonym.entry
  • import.synonym.start
  • import.synonym.due
  • import.synonym.recur
  • import.synonym.end
  • import.synonym.project
  • import.synonym.priority
  • import.synonym.fg
  • import.synonym.bg
  • import.synonym.description

Please note that it is wise to backup your task data files before an import.



Copyright 2006-2009, P. Beckingham. All rights reserved.