Understand how data source files work with Adobe InDesign to create personalized documents through data merge.
A data source file provides the variable information that InDesign uses during a data merge. It usually comes from a spreadsheet or database, but you can also create one using InDesign or a text editor. Each row represents a complete record, and each column represents a specific field, such as a company name or address. InDesign reads this structure to populate your document with different information for each version.
Structure and format requirements
Save data source files as comma-delimited (CSV), tab-delimited (TXT), or semicolon-delimited text files. In these files, paragraph breaks separate records, and commas, tabs, or semicolons separate fields. You can also include text or file paths that point to images on disk.
Fields and records
Each row represents a complete record, and each field is separated by a delimiter. To include a comma or quotation mark inside a field, enclose the text in quotation marks. You cannot insert a line break within a field. If the content spans multiple lines, create separate fields such as <<Address1>> and <<Address2>>.
Blank lines during merge
Select Remove Blank Lines For Empty Fields (Window > Utilities > Data Merge > Content Placement Options) when merging to prevent empty lines. A line is removed only if it's completely empty, even if a space prevents it from being deleted.
Text data considerations
If you want to include a comma or quotation mark in a comma-delimited file, enclose the text within quotation marks, such as “Brady, Hunt, and Baxter, Inc.”. If you don't include the quotation marks, each name is treated as a separate field.
When working with multiline content:
- Enclose fields containing line breaks in double quotes.
- Line breaks within quoted fields are treated as part of the field value.
- Fields without line breaks, such as Bob Johnson’s comment, are treated as single-line values and don’t require double quotes unless needed by standard CSV formatting rules.
Support for UTF-8 encoded CSV files
Data Merge supports UTF-8 encoded CSV files, allowing you to work with multilingual content, accented characters, emojis, and other special characters. Save your CSV file in UTF-8 format (with or without BOM), especially if it contains non-English or special characters.
When preparing your CSV file:
- Fields such as Name, Message, and Emoji can contain accented Latin characters, multilingual text, and emojis that are correctly represented in UTF-8.
- Save the CSV file using UTF-8 encoding in your text editor. For example, in VS Code, select File > Save with Encoding > UTF-8.
- Use a font that contains the required glyphs for the characters and symbols in your data source.
Vytvárajte tlačené a digitálne materiály s produktom InDesign
Navrhujte pôsobivé reklamy, rozloženia časopisov a kníh a nielen to.