Skip to main content
Participant
December 11, 2007
Question

Data Sets in Photoshop CS2

  • December 11, 2007
  • 17 replies
  • 46989 views
I'm trying to learn about scripting in Photoshop CS2. By starting, I just want to import variable data into Photoshop, following the help instructions, however am having heaps of issues.

I'm using the Image > Variables > Data Sets > Import option.

My data looks like this..

Variable1
Ben
David
James
Mark

but when I try to import the text file, I get this error message...

"Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."

Can anyone please tell me what I'm doing wrong?

Thanks
This topic has been closed for replies.

17 replies

Participant
April 9, 2008
Just in case any one else has had issues with Photoshop variables, here are a couple of things I've worked out in the last few hours of faffing trying to get data sets and variables to work.

You can't have any commas following your last variable or data, otherwise photoshop will see it as another variable. I.e., it must be

a,b,c,d

not

a,b,c,d,

If anyone's still confused with the layout and format of the csv file containing the data for photoshop, it is:

variable1, variable2, variable3, variable4...
dataforvariable1dataset1, dataforvariable2dataset1, dataforvariable3dataset1, dataforvariable4dataset1...
dataforvariable1dataset1, dataforvariable2dataset2, dataforvariable3dataset2, dataforvariable4dataset2...
dataforvariable1dataset1, dataforvariable2dataset3, dataforvariable3dataset3, dataforvariable4dataset3...

Finally, if you've got any commas in your data (E.g. in a piece of text), you'll need to enclose the data in quotation marks - "". This is good practice anyway to be honest, and saves a lot of hassle in the long run:

variable1, variable2, variable3, variable4...
"dataforvariable1dataset1","dataforvariable2dataset1","dataforvariable3dataset1","dataforvariable4dataset1"...
"dataforvariable1dataset1","dataforvariable2dataset2","dataforvariable3dataset2","dataforvariable4dataset2"...
"dataforvariable1dataset1","dataforvariable2dataset3","dataforvariable3dataset3","dataforvariable4dataset3"...

Cheers,

Ad
Participant
August 20, 2010

I've been trying to do the following in photoshop for 3 hours now,  I want a sequence of numbers to appear in a box one by one but now I'm not sure this is the best method to follow. So what I do is this: first I open my document and double click on the text layer, which in turn opens another document (a .psb file, I don't have an idea why) and there I define a TextVariable1 and import a .csv as my dataset. This is what it looks like ->

myvariable1
01
02
03
04
05
06

  

Now, when I click ok it says: "the name 'myvariable1' is not a variable in the current document". The only variable I see [in the Variables dialog] is TextVariable1 with a value of 01 and layer 01, no more.

What I don't understand is why no other method described in this thread is working for me. I've tried separating the numbers by commas, with or without a variable name, checking and unchecking the 'use first column for data set names' square. Maybe something is escaping me, but what exactly?. Thanks for your help, I'm kinda new to this.


EDIT: solved. I guess it was obvious that myvariable1 should have been Textvariable1 instead, but it was Not that obvious to me. NOTE: It doesn't make a difference if I have any value set for that in the dialog.

Participant
February 21, 2008
Hey all,

OK, I'm an idiot, I've worked it out. For anyone dumb like me, who needs a little help, here's what I was doing wrong.

I wanted to do a variable text replacement, to replace the text with variables from a text file.

What I neglected to do, was to create the variable text within the image BEFORE trying to import the data.

I created a layer with a text box containing <Var1>. The first line of my data text file also contained the variable name Var1. Now I was able to import a data set and apply it to the layer variable.

I also read the Photoshop help more carefully, so I don't really have anyone to blame except myself :)

Thanks everyone, I hope someone else finds this information useful.
Participating Frequently
March 3, 2021

Hi Ben, I know it's been YEARS, but I'm having this same problem and did create the variable text within the image before trying to import the data, but I still get that error message. I did everything exactly as it is explained in this video:

https://youtu.be/DftAUHgalkM 

 

I converted the Excel spreadsheet into a .csv (comma delimited), and created a  Photoshop image with one text layer called "Name", which matches the text in the first box (top of the first column) in the spreadsheet; and another text layer called "Degree", which is the title at the top of my second column. I then did Image > Variables > Define and defined each of the two layers for text replacement with the same name. Then I imported my .csv file, but when I try to click "OK", I get that same error message: "Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."

 

I see that Adam_Pilarski has provided layout and format information, which I honestly cannot understand at all, and is not what the tutorial I saw said. Photoshop's website no longer offers this tutorial. Somebody please help!

 

~Sky

Participating Frequently
March 3, 2021

Nevermind, I realized that I did have commas between some text in the second column of my spreadsheet, so as Adam_Pilarski suggested, I put quotations around any text that contained commas. Didn't get the error this time!

Inspiring
February 21, 2008
Ben, how was your data file created? Are you sure that it is plain ASCII text?.

I have seen that error with non-ASCII text files. I think it is reading a non-printing char code as another variable.

Mike
Participant
June 10, 2020

I want to respect the comments and suggestions in helping  _Ben_Bickley_. They're definitely in the spirit of troubleshooting. I have the same exact problem, same errors, and no matter how much I try, the errors abound. I couldn't even get as far as this error with Illustrator. Is anyone here as impressed as I am about how finicky both PhotoShop and Illustrator are regarding the recognition of a simple data set? This is sort of absurd.

Participant
February 20, 2008
hi Larry,

Yep, that's exactly what I did, and have done again. No matter how I try it, I get the original error message...

"Could not parse the file contents as a data set. There were too many variable names in the first line of the text file."

I only have one variable name! Crazy...
Participating Frequently
February 15, 2008
Have you performed the define variables? That is: Image > Variables
>Define

Larry
Participant
February 13, 2008
No Mate. I didn't ever get it working. Maybe start a new post for the topic? See if you get any responses.
Participant
February 12, 2008
Did you ever solve this? I am having the same problem.