Use tab-delimited text files
Learn how to create a tab-delimited text file, enter dates in a tab-delimited text file, and use Microsoft Excel to create tab-delimited text files.
Tab-delimited text files are an easy way to import metadata for multiple files. Use tab-delimited text files to import:
- Metadata into a specific field
- Multiple files
- Single compound object
- Multiple compound objects
Creating a tab-delimited text file
Regardless of how you use a tab-delimited file, follow these guidelines:
- One field must contain the file name of the items.
- For best results, place the field that contains the file names of the imported files as the last field in your tab-delimited text file.
- All collection metadata field names must appear in the first record of the tab-delimited text file.
- The file names must exactly match the contents of the upload directory for the files. One single mismatch causes the entire upload to fail.
- Use a tab for the delimiting character.
- End each record with a carriage return.
- Do not use carriage returns or tabs within a field.
- The end of the document should be the very end of the last word in the last line, with no extra blank lines or spaces.
- Remove special characters from file names and collection metadata field names. Special characters are: \ / : * ? " < > |
- When entering file names, enter only the file name of the item, such as item.jpg. Do not enter full path names such as c:\windows\item.jpg.
- When entering file names, be sure to include the extension, even if your operating system hides the extension type. Common extension types are JPG, TIF, GIF, and PDF.
- When importing files, use unique file names for each item. Using capital letters in the file name does not make the file name unique. The file name item.jpg is treated the same as ITEM.jpg and ITEM.JPG.
- Field name mapping need not be 1:1. Multiple tab-delimited fields may map to a single CONTENTdm collection field or you might have fewer fields in your tab-delimited file than in your CONTENTdm collection.
- One or more fields must map to the Title field of your collection.
- Store all of your items referred to in the tab-delimited file in one directory.
Entering dates in a tab-delimited text file
If importing dates to a Date data type field, they must be valid dates in the following supported formats:
Supported formats |
Format |
Example |
Supported Formats |
yyyy-mm-dd
yyyy-mm
yyyy
mm/dd/yyyy
mm/yyyy
yyyy-yyyy |
2009-01-01
2009-01
2009
11/30/2008
11/2008
2008-2009 |
Supported delimiters between dates |
Comma (,) and
semicolon (;) |
2008, 2009
2008; 2009 |
Supported delimiter in date range |
Hyphen (-) |
2008-2009 |
Leading spaces are okay but not required when using multiple dates |
YYYY; YYYY; YYYY
YYYY;YYYY;YYYY |
2007; 2008; 2009
2007;2008;2009 |
After dates are added to the project spreadsheet, they will be displayed in a yyyy-mm-dd format.
Use Microsoft Excel to create tab-delimited text files
In addition to the general guidelines highlighted above, there are specific guidelines for creating tab-delimited text files using Microsoft Excel:
- Turn off the text wrap option before saving as a tab-delimited text file. Using the text wrap option sometimes places a special character at the end of the line, which then causes the import to fail.
- For cleanest metadata, replace quotation marks within fields with apostrophes. Otherwise, when the spreadsheet is converted to a text file, another set of quotation marks is added next to the quotation marks. For example, if you have a field in Excel that contains the following:
Frank "Ol' Blue Eyes" Sinatra
Once the file is saved as a text file, the tab-delimited text file will read:
"Frank ""Ol' Blue Eyes"" Sinatra" unless you change the quotation marks to apostrophes.
See Troubleshoot tab-delimited text files for help resolving problems.
Compound object formatting
Specific rules apply when creating compound objects with tab-delimited text files:
- The first row contains the field names that you are adding. If you are adding URLs, include a field name that refers to the URLs you are adding.
- The second record contains the compound object-level metadata.
- Subsequent records, if desired, contain page-level information, including titles and other metadata, and the file names that correspond to the pages in the compound object. If you are adding metadata only, the File Name field is empty. If you are adding URLs, subsequent records contain the URLs that make up the compound object, titles, and other metadata.
Monograph formatting
A monograph has more structure than any other form of compound object. As such, it has two required fields that must be the first and second fields in the tab-delimited file:
CDM_LVL. Defines the level of the compound object file. CONTENTdm supports up to 9 levels in a monograph. The first level is 0. For example, a title page, table of contents, and preface may all be at level 0 … Chapter Headings may be at Level 1 … Section Headings may be at Level 2 … When importing monographs with tab-delimited text files, the text file must have a CDM_LVL field.
CDM_LVL_NAME. Defines the name of the level of the compound object file. For instance, Chapter 1 and Chapter 2 may be the names of Level 1 Names. All records within the same level must contain the same CDM_LVL_NAME.
You must have compound object metadata in the second row of the metadata file. Begin adding metadata in the CDM_LVL_NAME field. If the CDM_LVL_NAME field is empty, you will receive an error. In the case of CDM_LVL 0, each record must contain the same metadata in CDM_LVL_NAME. For example, note that each instance of Level 0 in the screenshot below is named "History of Ohio Canals."