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

Batch find change using excel file

New Here ,
Oct 20, 2011 Oct 20, 2011

Hello

I am a complete novice at scripting but wanted to know if this is possible. We produce a catalogue for use in Europe. We take a USA version and Europeanise it. This includes changing product part numbers from USA part numbers to European part numbers. If we had an excel file containg all of the USA part numbers that needed to be changed in a column called USA Part No and a column containing all of the European part numbers that need to replace them as European Part No would it be possible to use this file to do a batch find change across the catalogue?

Thanks for your help

Gary

TOPICS
Scripting
859
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
LEGEND ,
Oct 20, 2011 Oct 20, 2011

Yes, it's possible and fairly easy.

It's tricky to read Excel files from InDesign scripts, so it is probably easier to export your Excel file to a CSV file and have the script read that file. Perhaps that is a minor detail to you (perhaps it is not).

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 ,
Oct 20, 2011 Oct 20, 2011

Thanks for your help John!

Converting it to a csv file would be fine. How would I go about trying to script it? Would it cause a problem if there was an entry for a USA product that was removed from the European version?

Thanks

Gary

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
LEGEND ,
Oct 21, 2011 Oct 21, 2011
LATEST

Ah, so not  only do you want to know if it is possible, you actually want to do it!

Well, you get to select a scripting language and implement the solution. I would suggest Javascript, because it cross-platform, but some people prefer Applescript or VB.

How would you go about scripting it?

Well, there are lots of ways, but I would have the script start by reading in the CSV file and splitting each line into a search string and a replace string, and storing that pair in an array.

Then, iterate over the array and tell InDesign to run a find/replace with the given pair.

But perhaps your question was more concrete than that? You can find a myriad of tutorials and examples and soforth at the Scripting Resources page.

(On the other hand, you could instead adjust your Excel file to produce output compatible with the FindChangeByList script, and then not write any scripts. But you might find it more annoying to match its exact format in Excel, which is not really designed for that. Or maybe you'd find it easier.)

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