14 Replies Latest reply on Nov 11, 2015 10:16 AM by wideEyedPupil

# How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

 Brazil 2 2 2 0 1 0 0 0 0 1 1 1 1 1 0 0 0 12 Cameroon 2 2 2 2 2 2 1 1 1 1 2 2 2 2 1 1 1 27 Canada 2 2 2 2 1 1 1 1 2 1 0 1 1 2 0 0 19 China 2 2 2 2 2 1 1 2 1 1 1 1 1 0 1 1 1 1 23 Colombia 2 2 0 0 0 0 0 0 1 1 1 1 0 0 0 8 Denmark 2 2 2 0 2 1 1 1 1 1 2 2 2 1 1 1 1 1 24 Egypt 2 2 2 2 1 2 1 1 1 1 1 1 0 1 0 1 1 0 20 Georgia 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 22 Hungary 2 2 2 2 1 1 0 0 0 0 1 1 1 1 0 0 0 0 14

So I want do a GREP style find and replace where I search for "0" and put a solid red circle in the table, search for "1" and I place a solid amber circle and "2" and solid green circle. Could be images or a glyph I suppose. (interested if images is possible I saw a InDesign training video on Adobe Communities where they placed clip art to style the 'look' of the table to be "interesting" (old school fancy design) so I think this is doable but I forget how. Otherwise I guess I can figure a glyph replacement out with the practice I've been getting.

If I can continue to search and modify the three sets of circles i.e. change red ones to blue ones then that would be handy, thinking object styles or char colour I guess. I think the empty squares should be zeros I need to check on that.

• ###### 1. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

HI,

… So simple with Grep! I like the using of anchored blocks to give more visual effects!

• ###### 2. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

yeah but I find anchor blocks a bit random to control precisely. And how do I describe the anchored block to GREP in the "Change to" field.

Say I use clipboard object and it's an graphic, how do I ever change them again, I need to keep my workings yes? How to control the positioning of all those objects? Object styles?

• ###### 3. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

10 minutes!

• ###### 4. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

You can use a font or a block!

Here, I choose the way with a circular block, 3 object styles [If I modify effects on "Red", these modif. play for "Orange" and "Green" too (based on)], a grep style (to make invisible 0, 1 and 2) and a simple regex (to insert my color circles).

With this way, It's easy [3 clicks on find/replace] to change the circle by a triangle, …

• ###### 5. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

It's a pity I didn't see your response because i was rushing and I did the find/replace with replace-find=next and it was a slow operation like 0.5 second per replace and I had hundreds. I was super tiered and couldn't think a way to stop it from going past the table into my long document full of numbers. /b2/b is perfect — like I say I was tired. The first time I i did it I was clicking the shortcut too fast and it went into the next chapter replacing twos with red circles. I had to force quit InDesign as start again.

Also with a bullet it won't fill the cell, a block would have been better in hind sight but didn't want to get outside comport zone too much with massive time pressure to finish.

• ###### 6. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

wondering why you have change to GREP code as \$0~C. when I do that I get the 2 beside the circle, if the circle could cover up numbers that would be good for post-processing reasons but I think I'll just go for a replace unless there's some formatting trick

• ###### 7. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

I keep the numbers 0, 1 and 2. That's what I mean using a grep style to make the numbers "invisible"!

Then It's easier, e.g., to use a grep research as: \b1\b~a (then 1 and 2) and replace by another object!

• ###### 8. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

Another interest I thought: If you modify them, you can easily recalculate the last column … into InDesign! To do that, you'll need the numbers!

• ###### 9. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

oh, grep style — off course!! but hang on, how does a GREP style know what is in the clipboard?! does it actually record the clipboard contents when you make the GREP style?! That is so freaking clever if it does, about to try. (I'm bit slow to grok — only 12 hours sleep in last four days Lolz)

That  answers my next question, how can I change the size of the circles once they are in the matrix, as object styles have no size or scale varaibles/properties. would have to remake the style that is all.

next time screengrabs en anglaise, s'il vous plaît! (that's a joke :-) ) as is autocorrect: soil vous plait

• ###### 10. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

The Grep style only makes the numbers "invisible"!

To insert the 3 color circles, 3 steps:

Copy the first circle anchor (it will be pasted in the clipboard) and launch the first regex ("0").

Copy the second circle anchor (it will be pasted in the clipboard) and launch the first regex ("1").

Copy the third circle anchor (it will be pasted in the clipboard) and launch the first regex ("2").

If you modify the "circles", you surely will need to play the 3 regex again (as above). That's because I keep the numbers!

• ###### 11. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

i tried to do this myself and I just realised I had it back to front! thanks for the extra instructions! :-)

• ###### 12. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

Obi-wan Kenobi wrote:

Another interest I thought: If you modify them, you can easily recalculate the last column … into InDesign! To do that, you'll need the numbers!

I don't understand what you meant here. You mean linking to a live spreadsheet file with the "Link Text and Spreadsheets" Preference turned on in file handling or something else?

• ###### 13. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

No! Javascript to do this!

If you modify the numbers, launch the script again:

• ###### 14. Re: How can I convert arbitrary numbers [0,1,2] in a table to anchored objects (think traffic light)

Ah yes I've been thinking to do a script for redoing the background shading. Automatic alternate shading settings can't do everything you'd want. thinking about a script to help people do this kind of thing without being to 'technical' and doing fancy shading beyond the table function presets.