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

Data Sets in Photoshop CS2

Community Beginner ,
Dec 10, 2007 Dec 10, 2007

Copy link to clipboard

Copied

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
TOPICS
Actions and scripting

Views

43.6K

Translate

Translate

Report

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
New Here ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

Did you ever solve this? I am having the same problem.

Votes

Translate

Translate

Report

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 Beginner ,
Feb 13, 2008 Feb 13, 2008

Copy link to clipboard

Copied

No Mate. I didn't ever get it working. Maybe start a new post for the topic? See if you get any responses.

Votes

Translate

Translate

Report

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 ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

Have you performed the define variables? That is: Image > Variables
>Define

Larry

Votes

Translate

Translate

Report

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 Beginner ,
Feb 20, 2008 Feb 20, 2008

Copy link to clipboard

Copied

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...

Votes

Translate

Translate

Report

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
Guru ,
Feb 21, 2008 Feb 21, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 ,
Jun 10, 2020 Jun 10, 2020

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 Beginner ,
Feb 21, 2008 Feb 21, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 Beginner ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 Beginner ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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 09, 2008 Apr 09, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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 ,
Aug 19, 2010 Aug 19, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 Beginner ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

I do have commas in my original spreadsheet, which need to remain in the text. As Adam_Pilarski suggested, I put quotations around my text which contained commas, and that got rid of the error message I was getting. However, the quotations I added actually show in the final product, but I do not want to see quotation marks. Is there a way do do this in a way that I don't have to add quotes, or in a way that the quotations are ignored? I've attached images of both my spreadsheet and one of the resulting images. Thanks!

Votes

Translate

Translate

Report

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 Beginner ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

Also just figured out that after I create the .csv from the Excel file, I have to close everything, then go into my finder and directly open that .csv file. Now re-opened, the columns are incredibly narrow in width for some reason. I needed to widen the columns so that all of the contained text fits inside without being cut off, then re-save. When I don't do this, I get the error message; commas or no commas.

Votes

Translate

Translate

Report

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 25, 2008 Apr 25, 2008

Copy link to clipboard

Copied

Like that way if you do it then certainly an error message will apper in the screen.Two points you have to keep in your mind..i.e you have to create the variable text within the image BEFORE trying to import the data and the second point is you can't have any commas following your last variable or data, otherwise photoshop will see it as another variable.

Martin Fowl

Votes

Translate

Translate

Report

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 28, 2008 Apr 28, 2008

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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 30, 2008 Apr 30, 2008

Copy link to clipboard

Copied

Like that way if you do it then certainly an error message will apper in the screen.Two points you have to keep in your mind..i.e you have to create the variable text within the image BEFORE trying to import the data and the second point is you can't have any commas following your last variable or data, otherwise photoshop will see it as another variable.

Martin Fowl
| inkjet
cartridge
| data recovery
| data recovery |

Votes

Translate

Translate

Report

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 ,
May 23, 2008 May 23, 2008

Copy link to clipboard

Copied

Hi everyone,
I am able to put variable text in my psd document by creating the data sets manually, but I still don't understand how to set it up as a .csv or .txt file.

Could someone show me how it actully looks with real names?

Thanks much,
Mary Jo
msajdowitz@yahoo.com

Votes

Translate

Translate

Report

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 ,
May 27, 2008 May 27, 2008

Copy link to clipboard

Copied

Mary Jo:

A .csv file would look like this with the variable defined on the first line separated by commas, and subsequent lines containing the actual values, again separated by commas. Each line is completed with a carriage return (enter)not a comma.

FirstName, LastName, Employer
Steve, Jobs, Apple Computer
Bill, Gates, Microsoft Corporation
John, Doe, Some Company
Jane, Smith, ACME Printing

The file should be created in plain text, not rich text. Make sure your text editor is set up to format this way. Also, save the file with a .csv extension.

Hope this helps.

Votes

Translate

Translate

Report

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 ,
Aug 18, 2010 Aug 18, 2010

Copy link to clipboard

Copied

I had a similar error, using CS4.  Turns out Photoshop did not like me having an extra named column,  not used as a variable, which I had for my own record purposes.  Deleteing that solved the problem.

Votes

Translate

Translate

Report

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 13, 2014 Dec 13, 2014

Copy link to clipboard

Copied

Hi All,

I thought I'd throw my two cents in to this discussion. Hopefully it will help someone chasing some answers to the error you get when trying to parse the csv file into data sets.

After building a test excel sheet then saving as csv I tried to import this data set into photoshop and got this 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."

After opening this csv file in text edit, I discovered the data had included a couple of spaces (which to me looked like a double comma) at the end of each line.

               Title1,Title2,Title3,Title4,Title5, ,

This turned out to be an operator error, as I had applied the space bar in a couple of columns without realising.

Simply removing these, and/or make sure your "empty" cells are actually empty. Your raw data should end on the last input data and nothing more.

               Title1,Title2,Title3,Title4,Title5

I was able to import the data set without any errors.

Hope this helps?

Andrew.

Votes

Translate

Translate

Report

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 ,
Jan 31, 2016 Jan 31, 2016

Copy link to clipboard

Copied

I just messed around with this too.

Here was my problem & solution:

I had 3 layers with data (one variable field per layer), but in my spreadsheet / tab delimited file I had 6 columns of data.  I assumed that Photoshop would be able to look to the table and find the data related to that column (and ignore other columns).  I was wrong.  It appears you need to have the same number of columns in your data table as fields in your document.

Votes

Translate

Translate

Report

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 Beginner ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Spot on Matdog123

The error is misleading. There are not 'too many' variables in the first row of the text file (or spreadsheet columns) per se. You can have lots of variables listed there.

What it means is that there are more variables listed in the text file relative to those present in the Photoshop file.

The relevant variable must be added to Photoshop layers and Image > Variables > Define, or deleted from the spreadsheet and text file to synchronise them.

Votes

Translate

Translate

Report

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 ,
Feb 04, 2018 Feb 04, 2018

Copy link to clipboard

Copied

Plz follow this link Photoshop error "could not parse the file contents as a data set." - YouTube

and see the video. I hope that your solution is available here. Thank You.

EDIT [video has bad audio interference - moderator]

Votes

Translate

Translate

Report

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 ,
Aug 08, 2018 Aug 08, 2018

Copy link to clipboard

Copied

Namastye

mera deta set file load karne par problem de rahahai

erre aa raha hai "could not purse file contain as a  data set .data set 11 was incomplete "

krupaya maragdarshan kijiye

dhanyawad

Votes

Translate

Translate

Report

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