# Importing and Exporting Data

&appname; is able to import and export a wide variety of data files, as well as search various Internet sites for information.

## Importing from the Internet

&appname; is able to search various Internet sites using the Internet Search Dialog. Entries may be directly imported and added to your current collection. The various providers are configured via the Data Sources Options.

Searches may use different criteria: Title, Person, ISBN, UPC/EAN, LCCN, or Keyword. Not all criteria are available for certain data sources. ISBN and LCCN values are for books only, while UPC or EAN values can apply to any type of item.

Once a search is initiated, the Search button becomes Stop which will end a search. As results are found, they are added to the list directly under the search box, where selecting an item will show the result without adding it to the collection. Clicking the Add Entry button will add all the selected items to your collection. If the data source has more results than were initially requested, the Get More Results button becomes active. Clicking Clear will remove all the current results and reset the search.

The &appname; Internet Search Dialog
The &appname; Internet Search Dialog

Only entries that match the current collection type will be found. The Description column provides additional information about the entry, in order to differentiate between videos in different formats, or books in different bindings, for example. Once an entry is successfully added to the collection, a checkmark is added to the first column in the list.

Multiple entries can be added at once by using the standard &kde; method for multiple selection, which usually involves holding the &Shift; or &Ctrl; key when clicking on an item.

To facilitate the use of barcode scanners, searches can include multiple ISBN/UPC values. Selecting the Multiple ISBN/UPC search check box will disable the search box and enable the Edit ISBN/UPC values... button, which will open a multi-line text entry box. Each ISBN should be entered on a line by itself. After closing the box, each ISBN will be validated for correct formatting. The ISBN validation is able to convert 13-digit EAN values, as well as full UPC codes, to the proper formatting. The ISBN list may also be read from a text file.

## Importing Data

&appname; offers three different actions when importing data. Replace current collection will close the current collection, and create a new one with the data from the imported file. Append to current collection tells &appname; to add all the entries in the imported collection to the current one, and to add any fields which don't currently exist. The Merge collection action is the same as appending, except that each imported entry is compared to the current ones, and any identical entries are skipped. &appname; attempts to identify matching entries which are not completely identical by comparing significant fields and will then merge the entries. For example, music collections compare the artist and album, and the tracks would be merged for matching entries. The audio file importer is able to correctly build track lists by merging entries.

### Importing Data From Other Software

&appname; can import data directly from a variety of other collection management programs, including GCstar, OnMyShelf, Data Crow, Alexandria, Delicious Library, Collectorz, Ant Movie Catalog, Referencer, and Griffith.

### Importing Other Data Formats

&appname; can import data from a variety of other file formats, including CSV, bibtex, audio discs and files, MODS, &PDF;, and RIS.

#### Importing &appname; Data

Other &appname; data files may be imported directly. Replacing the current collection by importing a &appname; file is the same thing as just opening the file itself. The value of importing &appname; data is primarily for appending or merging two collections together.

#### Importing CSV Data

Comma-separated values (CSV) are a common way of importing and exporting tabular data. Each field value is separated by a comma, with one entry per line. The field titles may be included in the first line. The CSV importer is not limited to using a comma as the separator. Any character or string may be used.

The CSV Import Dialog
The CSV Import Dialog

First, select the type of collection that you are importing. If you are appending or merging to your open collection, the type is limited to your current collection type. If the first line of the CSV file contains the field titles, click the check box and the importer will automatically compare the titles against the fields in the current collection. If a field title matches, the header for that column changes to show that the column has been assigned to that field. If the file uses a delimiter other than a comma, be sure to change that option accordingly.

In order for &appname; to properly import the file, it must know which field corresponds to each column. If the column only has a number in the header, the data in that column will not be imported. You should assign fields to each column by selecting a column, either by clicking in it or changing the column number itself, then selecting the field to assign from the drop down box and clicking the Assign Field button. If you need to add a new field to the collection, the last item in the drop down box opens the Collection Fields Dialog.

For compactness, only the first five lines of the imported CSV file are shown in the dialog. However, all the lines in the file will be imported.

#### Importing Audio &CD; Data

&appname; is able to use the freedb.org service to lookup information about a &CD;, including the track list. Depending on your distribution, settings for access to the service may be set in the &kde; &systemsettings;. The &CD; artist, title, genre, year, and track listing are all added.

In addition, if the disc contains &CD;-Text, that information is read and added to the imported entry.

#### Importing Audio File Metadata

&appname; is able to scan a folder and read the tags for common audio file formats, such as `mp3` and `ogg`. The songs are entered in a music collection, where each entry is an album. If the song files contain the track number, the song name is inserted in the correct spot in the track list. The artist and genre information is also added to the entry. If the song tags contain comments, they are appended to the comments field in the entry, preceded by the file name.

In addition, if a folder contains a `.directory` file and the folder name matches an album title, the `Icon` entry in the desktop file is used as the cover image for the album.

The audio file metadata importer can recursively scan a folder to find all audio files in any subfolder, though symbolic links are not followed. &appname; uses the TagLib library for reading the audio file metadata, and so can import data from any file type that TagLib understands.

#### Importing Bibtex Data

Bibtex is a bibliography format used with the LaTeX document preparation system. Various type of bibliographic references may be included in the file. &appname; imports bibtex files as a Bibliographic collection.

If the bibtex importer encounters fields in the file which are not in the default bibliography collection, they are added as Simple Text fields, with two exceptions. If the field value contains more than 100 characters, it becomes a Paragraph field. If the field value appears to contain a &URL; or a file reference, then a &URL; field is created. &appname; uses an internal copy of the btparse library for parsing the bibtex files.

Bibtexml is an &XML; representation of bibtex data, and the data from the imported bibtexml file is treated in the same way as bibtex data would be.

#### Importing MODS Data

MODS is a format for representing various types of media collections. Currently, only books are imported by &appname;, as a Bibliographic collection.

#### Importing &PDF; Data

If &appname; was compiled with exempi or poppler support, metadata from &PDF; files can be imported. Metadata may include title, author, and date information, as well as bibliographic identifiers which are then used to update other information.

#### Importing RIS Data

The RIS format is a bibliographic file format used by EndNote, Reference Manager, and others. &appname; imports RIS files as a Bibliographic collection.

### Importing Online Collections

&appname; can connect to and import from websites that manage personal collections.

#### Importing BoardGameGeek Collection

BoardGameGeek is an online board gaming resource and community. &appname; can import the board games in a user's collection, as long as the collection is set to be publicly accessible. The imported collection may be limited to those items marked as being owned.

#### Importing Goodreads Collection

Goodreads is an online social network for readers to track book collections. &appname; can import the list of books in a user's collection, given either the user name or user ID, as long as the collection is set to be publicly accessible.

#### Importing LibraryThing Collection

LibraryThing is an online service to help people catalog their books easily. &appname; can import the list of books in a user's collection, exported in JSON format.

#### Importing Discogs Collection

Discogs is an online database and marketplace of music releases. &appname; can import the list of music releases in a user's collection, given the user name, as long as the collection is set to be publicly accessible.

### Importing File Listings

&tellico; can scan folders to import file information, primarily to create a File Catalog collection. The folder may be searched recursively, to add all files found within. This importer is most useful for backup listings and media cataloging, such as &CD; or DVD listings. In addition, image previews of the file contents may be generated. The file previews are same as those shown in the &kde; file manager.

Folders with ebook files and video files may also be imported as book and video collections. File metadata can be read, and for video files, any existing `nfo` files are used to complete the video entry information.

### Importing &XML; Data via XSLT

Any &XML; file may be imported into &appname; provided an &XSL; stylesheet is available to convert the file to &appname; format. &appname; automatically loads the stylesheet and performs the &xslt; processing needed to load the file.

## Drag and Drop

Dragging data files to the main &appname; window and dropping them will import the files, just as if the import command was made from the menus. Drag and drop works for the following file formats: Tellico, Bibtex, RIS, &PDF;, and EPub. Importing multiple files at once is also supported.

So, for example, if you want to catalog several &PDF; files, select them in the file manager and drag them to the &appname; window. &appname; will import as much metadata from the files as it can, and then fetch additional information from various configured Internet sources.

## Exporting Data

When exporting the data in the collection, the entry values may be exported as entered, or with the automatic formatting provided by &appname;. Additionally, the export may be limited to the currently selected entries of the collection as well, where the statusbar shows the number of selected entries.

Exported text files, such as Bibtex or CSV, may use the Unicode (UTF-8) character encoding, or the current locale of the operating system.

General Export Options
General Export Options

### Exporting &XML;

The file format for &appname; data is a zipped &XML; file. Exporting to &XML; merely creates the &XML; file without zipping it. Images may be included in the &XML; file as base64-encoded data in an image element, but doing so can create very large text files.

### Exporting Zip

The standard file format for &appname; is a zipped file, containing the &XML; collection file, and optionally, all the images referenced in the collection. If the images are being stored in the application folder instead, exporting to a Zip file will create a self-contained data file, which includes all the images in the collection.

### Exporting &HTML;

The &HTML; export uses the `tellico2html.xsl` stylesheet. Images are exported to a folder with the same name as the exported &HTML; file with `_files` appended.

The default format is similar to the printed output, and allows various options for modifying the &HTML;. Field headers may be printed at the top of each column, but unfortunately, &kde; does not yet allow the table headers to be repeated on each page. The entries may be grouped as in the Group View, as well.

Additionally, individual files may be created for each entry in the collection, with links created in the top-level &HTML; file. The entry files will be created in the same folder as the images. The entry &HTML; files will use the current stylesheet template, as shown in the Entry View.

&HTML; Export Options
&HTML; Export Options

### Exporting CSV

Comma-separated values (CSV) are a common way of importing and exporting tabular data. Each field value is separated by a comma, with one entry per line. The field titles may be included as headers in the first line. Any character or string other than a comma may also be used to delimit the fields.

CSV Export Options
CSV Export Options

### Exporting Alexandria

Alexandria is a book collection manager for the GNOME desktop environment. &appname; is able to export a limited subset of book collection fields to the default Alexandria data location.

### Exporting ONIX

ONIX is an &XML; format for representing and communicating book industry product information, primarily for book vendors. &appname; can export book collections using a small subset of ONIX.

### Exporting Bibtex

When exporting to Bibtex, the field values may be escaped with braces or quotation marks. If any string macros are used in the collection, they may optionally be exported as macros or expanded. For &URL; fields, &appname; may enclose the field values with the `\url{...}` tag. Finally, entries with no citation key may be skipped rather than have &appname; auto-generate the key.

Bibtex Export Options
Bibtex Export Options

### Exporting GCstar

GCstar is another movie collection manager. &appname; is able to export most collection types to a GCstar data file.

### Exporting &XML; via &xslt;

Finally, &appname; is able to process its internal &XML; representation of the collection data through an external &XSL; stylesheet before exporting. This type of export may be useful for generating text reports or other file types.

## Working With Citations

When working with a bibliography, citations for the currently selected entries may be generated and used in various other applications. A citation in bibtex format can be copied to the clipboard, and then pasted in a latex file. Bibtex citations can also be pushed to an external application such as LyX or Kile using the so-called lyxpipe.