Skip to main content
January 15, 2026
Answered

Automate adding content to multiple table cells.

  • January 15, 2026
  • 2 replies
  • 107 views

Need to add "$" to multiple cells in many tables. I'm hoping to automatically, like find and replace. Would there be a GREP for this? It's for French figures, so the "$" is at the end of the cell, i.e., "345 $".

Screenshot 2026-01-15 at 11.03.44 AM.png

Correct answer FRIdNGE

Just select a table and play this regex:

 

Find: \d\K$

Replace by:  $

(I mean: a normal space + a dollar)

 

(^/)  The Jedi

2 replies

FRIdNGE
FRIdNGECorrect answer
January 15, 2026

Just select a table and play this regex:

 

Find: \d\K$

Replace by:  $

(I mean: a normal space + a dollar)

 

(^/)  The Jedi

January 15, 2026

OMG you are a Jedi! That's perfect. I'm going to use this often!

Thanks so very much. 

Zoe

Stefan Rakete
Inspiring
January 15, 2026

As a start:

// select a table and run the script
var curSel = app.selection[0];

if (curSel.constructor.name == "Table") {
    var allCells = curSel.cells;
    for (var c=0; c<allCells.length; c++) {
        var curCell = allCells[c];
        if (curCell.contents != "") {
            curCell.contents = curCell.contents + " " + "$";
        }
    }
} else {
    alert("Pls select a table");
}