3 Replies Latest reply on Oct 21, 2011 7:27 AM by John Hawkinson

    Batch find change using excel file




      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



        • 1. Re: Batch find change using excel file
          John Hawkinson Level 5

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

          1 person found this helpful
          • 2. Re: Batch find change using excel file
            flunkemonkeygj Level 1

            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?





            • 3. Re: Batch find change using excel file
              John Hawkinson Level 5

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