Skip to main content
tylerm2734255
Participating Frequently
May 26, 2017
Answered

How can I add a letter prefix to all cells in a column?

  • May 26, 2017
  • 2 replies
  • 885 views

I have pages of existing InDesign (CS4) tables, filled with part numbers. We now need to add a single, constant letter prefix to each part number in a column. For example, right now a part number might be 220731 but I need to make it L220731. I need to do this for all items in the column, and I would like to be able to do it automatically. I already tried highlighting the column, and doing a replace based upon "replace *" with L* and that did not work.

Any thoughts?

    This topic has been closed for replies.
    Correct answer John Mensinger

    Using your example of the "L" prefix...

    1. Select the column
    2. Launch the Find/Change dialog and choose the GREP tab
    3. Find what: ^.+?
    4. Change to: L$0
    5. Search: Selection
    6. Click Change All

    2 replies

    amaarora
    Inspiring
    May 26, 2017

    Hi,

    What do you mean by part numbers?

    I am not so good with grep, but trying this simple query helped me achieve what i could make out from your question.

    I selected the portion of the table and then ran the grep ONLY on the selection.

    This is what I get then by hitting on "Change All"..

    Just to add, since it is not clear how the numbers are or what part numbers mean it is not clear what is the desired result.

    Running John's grep gives me somewhat different result than mine since it even converts words other than numbers to Lwords.

    -Aman

    John Mensinger
    Community Expert
    John MensingerCommunity ExpertCorrect answer
    Community Expert
    May 26, 2017

    Using your example of the "L" prefix...

    1. Select the column
    2. Launch the Find/Change dialog and choose the GREP tab
    3. Find what: ^.+?
    4. Change to: L$0
    5. Search: Selection
    6. Click Change All
    tylerm2734255
    Participating Frequently
    May 26, 2017

    Thanks so much John, this does exactly what I want. Saves me a lot of time.