KeePass Help Center KeePass Home | Downloads | Translations | Plugins | Donate 
Help Center Home | Forums | Awards | Links 







Generic CSV Importer

Details about the generic CSV importer of KeePass 2.x.


General Information

KeePass 2.x features a generic CSV importer. This tool can import almost all CSV formats. The CSV files are loaded and you can manually specify the encoding / character set, assign columns to data fields, and specify how the low-level structure looks like (usage of quotes, etc.).

To start the generic CSV file importer, click 'File' → 'Import' and choose 'Generic CSV Importer'.

Generic CSV Importer


Options

The importer features various options to configure the import behavior. Although it analyzes the CSV file and guesses the appropriate settings, you can change every option and configure the import behavior manually.

  • Encoding.
    As files simply contain bytes, byte sequences must be mapped to text characters according to some convention, which is called encoding. There exist many different encodings, and KeePass supports all commonly used ones.

    The encoding of the CSV file can be specified on the first tab page of the generic CSV importer. KeePass' guess for the encoding is correct most of the time, however if the text preview does not look ok (broken special characters, ...), you should try selecting different encodings and choose the one that produces the best text preview.

  • Syntax.
    Here you can specify the syntactical rules that the CSV file follows. Fields (like title, user name, password, etc.) are separated using the field separator; usually this is a comma, semicolon or tab. Entries are separated using the record separator; usually this is indicated by starting a new line. Field data is often enclosed by a text qualifier (which e.g. allows the other separators to be used within field data); usually the text qualifier is a quote character ("). Example:

    "Sample Entry 1","tom@example.com","12345","https://keepass.info/","Notes"
    "Sample Entry 2","Michael","TopSecret","https://example.net/","Notes"

    In this example, the field separator is a comma, the record separator is a new line character, and the text qualifier is the quote character (").

    Some CSV files use the backslash character '\' as an escape character. This e.g. allows separator and qualifier characters to be used within field values, and allows whitespace characters and separators to be encoded without using text qualifiers. For example, 'Pass\,word' then actually means 'Pass,word', and '\t' actually means a tab character. If you observe such escape sequences in the text preview, enable the option for interpreting '\' as an escape character.

  • Semantics.
    The layout of the fields must be specified exactly. Example:

    "Sample Entry 1","tom@example.com","12345","https://keepass.info/","Notes"
    "Sample Entry 2","Michael","TopSecret","https://example.net/","Notes"

    In this example, the layout is 'Title', 'User Name', 'Password', 'URL', 'Notes'. This layout must be specified exactly in the generic CSV importer; the fields list must not contain any additional fields and must not leave any out.

    Details on some field types:

    • Ignore.
      The Ignore field type indicates a column that should be ignored during the import. The importer will read the values for this column, but not do anything with it (i.e. not copy it to any entry field).

      This field type is useful when importing a CSV file that contains a column that cannot be mapped to any field supported by KeePass.

    • Group.
      The Group field type indicates a column that specifies into which (sub-)group the entry should be imported into. The group path must be in one column, with the group path nodes being separated by a delimiter. The delimiter usually is a forward slash ('/'), backslash ('\') or dot ('.'), however you can also specify any other character. Example:

      "Internet/EMail","Sample Entry 1","tom@example.com","12345"
      "Internet/Homebanking","Sample Entry 2","Michael","TopSecret"

      In this example, the layout is 'Group', 'Title', 'User Name', 'Password'. The group delimiter is '/'. When importing this CSV file, the first entry is imported into the subgroup 'EMail' of the group 'Internet'. The second entry is imported into the subgroup 'Homebanking' of the 'Internet' group.

      If the group delimiter is a backslash ('\'), make sure that the escape character option is activated/deactivated appropriately. If the escape character option is on, the backslashes delimiting the groups are expected to be encoded as '\\'.

      If KeePass has already guessed a 'Group' field type and you want to change the delimiter, remove the guessed 'Group' field and add a new one with the delimiter of your choice. It is not sufficient to select the existing 'Group' field and enter a separator within the 'Add field' area (this area is only for adding new fields, not edit existing ones).

  • Preview.
    This page shows a preview of how the imported entries will look like. If everything looks as expected, click 'Finish', otherwise 'Back' to correct any options.

Examples

  • Example 1.
    "Account","Login Name","Password","Web Site","Comments"
    "Sample Entry 1","User Name","Password","https://keepass.info/","Note"
    "Sample Entry 2","tom@example.com","Tom'sPass",,"This is a sample note"
    "Sample Entry 3","Fred","Password\,with\\escaped\"characters",,
    "Sample Entry 4","Michael321","12345","https://keepass.info/",
    The field separator is ',', the record separator is a new line character, and the text qualifier is the quote character (").

    In the line for 'Sample Entry 3', we see that '\' is used as escape character, thus make sure that the option for this is activated.

    The first line does not contain any data (it just shows the field types), thus make sure that the option for ignoring the first row is activated.

    Ensure that the layout list shows 'Title', 'User Name', 'Password', 'URL', 'Notes'.

  • Example 2 (With Groups).
    "Group","Account","Login Name","Password","Web Site","Comments"
    ,"Sample Entry 1","User Name","Password","https://keepass.info/","Note"
    "Group A\\Group B","Sample Entry 2","tom@example.com","Tom'sPass",,"This is a sample note"
    "Group A","Sample Entry 3","Fred","Password\,with\\escaped\"characters",,
    "Group C\\Group D.1","Sample Entry 4","Michael321","12345","https://keepass.info/",
    This example is similar to the first example, however now the CSV file also specifies the groups into which the entries should be imported. Ensure that in the layout field list the first field type is a 'Group', with the delimiter being '\' (recall that we activated the option for interpreting '\' as an escape character, thus in the CSV file the group delimiter '\' is encoded as '\\').

    The entries 2, 3 and 4 specify the name/path of a group. Entry 1 does not specify the name/path of a group and will thus be imported into the root group of the database.








Get KeePass