Import variable data sets from external files

Last updated on Oct 10, 2026

Learn how to use CSV or tab-delimited text files to quickly create multiple data sets for data-driven graphics in Adobe Photoshop on desktop.

Importing data sets from external text files lets you generate dozens or hundreds of data-driven graphics variations without manually creating each data set in Photoshop. This works well when you need to produce personalized marketing materials, badges, certificates, or any graphics where only certain elements change between versions.

This procedure imports variable data from a prepared text file into a Photoshop document that already has variables defined. The text file must follow specific formatting rules and include values for every variable in your document. Create data-driven graphics for instructions on defining variables and understanding data-driven graphics workflows.

Prepare your external text file

Your text file must follow a specific structure where the first line lists all variable names and subsequent lines contain values for each data set. You can create this file in any text editor or export it from Microsoft Excel.

File syntax requirements

Each element in your text file serves a specific purpose in defining your data sets:

Syntax element

Description

Separator character

  • Use either comma (CSV) or tab (tab-delimited) to separate variable names and values.
  • Newline character that ends each data set with a line feed, carriage return, or both.

true and false

Required values for visibility variables to show or hide layer content.

Spaces

Spaces around separators are removed during import. Spaces within values (like "two of a kind") are preserved. Leading and trailing spaces are kept only when the entire value is enclosed in double quotes.

Double quotes

Enclose values containing separator characters or newlines in double quotes. To include a literal double quote in your value, precede it with another double quote (for example, ""B"" becomes "B").

Example data set file

This is a text file for a flower template with three variables: visibility, text replacement, and pixel replacement.

Variable 1, Variable 2, Variable 3 true, TULIP, C:\My Documents\tulip.jpg false, SUNFLOWER, C:\My Documents\sunflower.jpg false, CALLA LILY, C:\My Documents\calla.jpg true, VIOLET, violet.jpg

Use relative file paths for pixel replacement variables when your text file is in the same folder as the referenced images. In the example above, violet.jpg uses a relative path while the other entries use absolute paths.

The first line declares three variables. Each subsequent line represents one complete data set with values in the same order as the variable names.

Import the data set file

Select File > Import > Variable Data Sets.

Navigate to your prepared text file and select Open.

In the import dialog, choose Use First Column For Data Set Names to name each data set using values from the first variable, or leave unchecked to use default names like Data Set 1, Data Set 2.

Select Replace Existing Data Sets if you want to delete any data sets currently in the document before importing.

Set the text encoding or leave it as Automatic for Photoshop to detect the encoding.

Select OK to complete the import.

After importing, your data sets appear in the Variables dialog (Image > Variables > Data Sets) where you can preview, edit, or export them. If there’s an error during import, verify if your text file includes all variables defined in the document and follows the required syntax.