xls variable data

Post Reply
abonsey
Member
Posts: 142
Joined: Fri May 24, 2013 5:10 pm

xls variable data

Post by abonsey »

I have a supplied xls file that I want to create variable data PDFs from and I'm looking for guidance on best practice.
My assumptions are:
1. Convert to csv - What's the best method and how's it done?
2. Merging data - into Indesign directly (can this be done) or using something like HP Smartstream Designer to merge the data?

Thanks for any help and advice given
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: xls variable data

Post by gabrielp »

I believe the Smartstream configurator will only take a csv or txt, even more annoyingly it has to match the name of the template file exactly (or rather the filename prefix had to match).

If I were you, I'd make a little script to convert xls to csv. If you look through NPM, you'll see a bunch of node packages which either do this already or do the xls parsing already. Writing a csv is pretty trivial.
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
abonsey
Member
Posts: 142
Joined: Fri May 24, 2013 5:10 pm

Re: xls variable data

Post by abonsey »

Any other options as I don't have the scripting module?
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: xls variable data

Post by gabrielp »

abonsey wrote:Any other options as I don't have the scripting module?
Hmm... Do you have access to "execute command"? Perhaps you could use something like curl from CLI through that configurator to invoke https://developers.zamzar.com or another service that converts those.

Another option might be dropping the xls into Google Drive and then somehow building a link that will export a csv when you GET: https://stackoverflow.com/questions/116 ... csv-format

Both seem kind of "out there". Maybe someone has some less crazy ideas :mrgreen:
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
abonsey
Member
Posts: 142
Joined: Fri May 24, 2013 5:10 pm

Re: xls variable data

Post by abonsey »

gabrielp wrote:I believe the Smartstream configurator will only take a csv or txt, even more annoyingly it has to match the name of the template file exactly (or rather the filename prefix had to match).

If I were you, I'd make a little script to convert xls to csv. If you look through NPM, you'll see a bunch of node packages which either do this already or do the xls parsing already. Writing a csv is pretty trivial.

I have a trial of the scripting module installed. I've never done anything like this before. Can you give me some guidance or step-by-step?
Hopefully somebody can :) :)
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: xls variable data

Post by gabrielp »

Honestly, I'd look at using a conversion service. There are Javascript libraries made to deal with xls files but you can't include external JS files in Switch Scripter so it would be tough.

So if you were going to use something like Zamzar, you'd need a curl script to do the following:

Code: Select all

 curl https://api.zamzar.com/v1/jobs \
-u GiVUYsF4A8ssq93FR48H: -X POST \
-d "@my_file.xls" -d "target_format=csv" 
When I use cURL, I usually build a bash script, save it to a file, then have Switch execute the file and remove it when done. Here are two examples of exactly that: But, that was before the HTTP class was available in Scripter. So now you could just use that (possibly even the HTTP configurator) to POST to the Zamzar API.
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
Post Reply