Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Variable Datasets shows Error: Not enough Names in first line

New Here ,
Dec 30, 2021 Dec 30, 2021

Hello there,

 

i'm new to Photoshop automation and wanted to try using DataSets to create a Test with a few hundered test images.

 

However when I get to the point where I want to import the CSV file I get the error:"Could not parse the file contents as a data set. There were not enough variable names in the first line of the text file." But when I look at different Videos on YouTube they all have their Data arranged the exact same as me, which is quite confusing. 

 

I've attached my CSV for reference.

TOPICS
Actions and scripting
3.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 30, 2021 Dec 30, 2021

It isn't the arrangement of the content in your CSV file that's the issue. You need to have the same number of variables defined in your Photoshop document as you have in your CSV file. Based on the error message, it sounds like you need to add the missing variable name(s) and corresponding data to your CSV file.

 

Also, if you want to use images as the data, make sure to set the variable type as Pixel Replacement, and in the CSV file, use the filename. Here's more info:

Photoshop Automation

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 30, 2021 Dec 30, 2021

I'm trying to mass-produce invites so there is no need for image replacement. However I need to replace the last name, address and the seating number with the ones given in the CSV File. So I should only need three variables in the CSV file, correct? (name, address, seatnumber) but for some reason I keep getting this error.

 

I've attached a file of my layers in PS2022 to visualize this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2021 Dec 30, 2021

@Unicode3_0 

 

The errors/warnings generated by Photoshop for variables are not always helpful.

 

Your text file is semi-colon ; separated – not comma , separated.

 

csv.png

 

Resave as comma separated and it should work as the attached did for me (or as a tab delimited file with a .txt extension).

 

P.S. The double quotes in my example are there because I always use the "quote strings" feature by habit (your example didin't use word spaces so there was no explicit need to quote strings).

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 02, 2025 Apr 02, 2025

Wondering what you found out here. I am getting the same thing but I have carefully checked and I have 16 variables in the PSD and 16 listed in the CSV. It's not an issue of semicolon vs. comma either. I checked that as well. 

 

I'm stumped. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 02, 2025 Apr 02, 2025

@Erik Jagger 

 

It's hard to comment without seeing the text and .PSD files.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2025 Jul 03, 2025

I will drop this here in case it helps anyone. I was getting the same error even when my document was set up perfectly. I tried all the different csv formats excel uses, none of them worked. Turns out if you simply paste everything in google sheets and save as csv, it will work. I don't know why, it just does. If you've set up the excel and nothing seems to work, try google sheets. I just copied and pasted everything, I didn't upload the excel file, it might work that way too, I just haven't tried it. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2025 Jul 03, 2025

Data sets are very particular, errors can cause spaces after the last input in any row. Once, I created a macro to check for and delete any extra spaces at the end of each line in the data sets file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2025 Jul 03, 2025
LATEST
quote

Once, I created a macro to check for and delete any extra spaces at the end of each line in the data sets file.


By @Bojan Živković

 

Yes, me too, on the Mac using BBEdit I have saved many regular expression pattern presets. I also use the "Show invisible characters" option:

 

grep.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines