18 Replies Latest reply on Jan 17, 2012 7:19 AM by Kirikokos

    Find/Change command! Me again!

    Kirikokos Level 1

      Hi guys!

       

      Any GREP style og text style for this, see the picture.

       

      I need to center the > | < in a table, so all the prices will be centered and look nice, like in the table 2 !

      HELP!

       

      c.jpg

        • 1. Re: Find/Change command! Me again!
          Eugene Tyson Adobe Community Professional & MVP

          All you have to do is

           

          Find \|

           

          Change to

          ~>$0~>

           

           

          Then select the table

           

          Then go the Type>Tabs

           

          In the "Align on" section type in |

           

          And then you'll see 4 arrows on the left side of the Tab Panel

           

          Pick the arrow on the far right.

           

           

          insert a TAB on the TAB ruler by clicking on it.

           

          Move the TAB until the | is aligned

          1 person found this helpful
          • 2. Re: Find/Change command! Me again!
            Mary Posner Level 3

            Just so. It doesn't even have to be done using GREP - a plain, old-fashioned text Find/Change will do it:

             

            Find what:

            |

             

            Change to:

            ^t|^t

             

            (But GREP is fun, so what the heck, go ahead and use it!)

            • 3. Re: Find/Change command! Me again!
              Kirikokos Level 1

              Hi Eugene,

               

              It almost worked, now I only need them to be align right. (second "row") see the picture.. any way to do that?

              cc.jpg

              • 4. Re: Find/Change command! Me again!
                Eugene Tyson Adobe Community Professional & MVP

                That's a bit trickier. Basicaly the Align On in the Tabs sets it so that the | is always aligned. Regardless of digits.

                 

                If you turn this off and insert a space, thin spce, hair space etc. before or after the | to space it out. Basically you're working off the width of the digit to insert a space. And you'll never really get them aligned that way.

                 

                99.99 | 99.99

                1.00   |   1.00

                 

                There will always be a bit off regards spacing doing it that way.

                 

                 

                The only way would be to Right Align all the Cells

                 

                Then insert a TAB as per Mary Posner sugested.

                 

                Then use a TAB stop on the TAB ruler to center align the | and then Right Align Tab for the numbers on the Right.

                • 5. Re: Find/Change command! Me again!
                  Peter Spier Most Valuable Participant (Moderator)

                  Not at all, methinks.

                   

                  Do the same query, but change to

                   

                  Change to

                  ~>$0\t

                   

                  to insert a second tab. In the paragraph style set your character alined tab as before, and a second, right-aligned tab where you want the right edge.

                   

                  As an alternative, that's probably even easier, you chould change to

                   

                  Change to

                  ~>$0~y

                   

                  and set the right indent on the cells (~y is a right indent tab).

                   

                  This is untested, but I think it will work.

                  • 6. Re: Find/Change command! Me again!
                    Kirikokos Level 1

                    As an alternative, that's probably even easier, you chould change to

                     

                    Change to

                    ~>$0~y

                     

                    and set the right indent on the cells (~y is a right indent tab).

                     

                    This is untested, but I think it will work.

                     

                    When I use that, I can't center the | with tabs, and the first digits are not right indent :S

                     

                    See the picture..

                     

                    c.jpg

                    • 7. Re: Find/Change command! Me again!
                      Peter Spier Most Valuable Participant (Moderator)

                      You didn't set the character aligned tab for the |. You still need to do that. Sorry if I was unclear.

                      • 8. Re: Find/Change command! Me again!
                        Kirikokos Level 1

                        Hm.. I'm thinking of something...

                         

                        Is there a GREP style for this:

                         

                        Find:

                        Find all the numbers cotaining four digits after |

                         

                        Change:

                        put a comma in the start - see the example:

                         

                        33.95|129.95

                        42.95|5.90

                         

                        >

                        42.95|,5.90

                         

                        and the same for 6 digits:

                         

                        Find:

                        Find all the numbers cotaining 6 digits after |

                         

                        Change:

                        put a comma in the start - see the example:

                         

                        33.95|129.95

                        42.95|5.90

                         

                        >

                        33.95|,129.95

                        42.95|,5.90

                         

                        Anything like this? Because then I got a idea to fix the right indent problem......

                        • 9. Re: Find/Change command! Me again!
                          Peter Spier Most Valuable Participant (Moderator)

                          GREP styles can only apply formatting, not change the actual text.

                          • 10. Re: Find/Change command! Me again!
                            Grant H Level 4

                            unless i missed something, what about cell styles, with a para style / grep / character style combo...

                             

                            G

                            • 11. Re: Find/Change command! Me again!
                              Mary Posner Level 3

                              Ah, it's the age-old question of wanting everything to align with everything and yet center on the available space.... 

                               

                              I don't know if this is practical for you, or if the scope of your project might be too big for this, but have you considered using tables to space and align things as you want? Put tabs around the pipe and select the whole thing, convert from text to table. Take the borders off the cells. Right align the columns with the numbers in them; center align the one with the pipe. Make each column as wide as it needs to be to accommodate the longest number, or to provide the amount of space around the pipe that you want, then center the whole table in your text box.

                               

                              Give it a try and see if that gets you the look you want.

                              • 12. Re: Find/Change command! Me again!
                                Kirikokos Level 1

                                Put tabs around the pipe and select the whole thing..

                                 

                                How?

                                 

                                The numbers are en each cells... like

                                 

                                32.95|99.95

                                 

                                = 1 cell

                                • 13. Re: Find/Change command! Me again!
                                  Kirikokos Level 1

                                  Guys.. If you wanna try it out, I have uploaded a indesign document with some prices, and how I want it.

                                   

                                  Can you crack the code?

                                   

                                  link:

                                   

                                  http://www25.zippyshare.com/v/23461715/file.html

                                  • 14. Re: Find/Change command! Me again!
                                    Peter Spier Most Valuable Participant (Moderator)

                                    First, you need to set either a character-aligned tab or a right-aligned tab where you want the | to appear in your cell. Next it seems we need to explicitily put the first tab into the string, as well as the right indent tab, so we need to find all the text leading up to the | and put a tab in front of it, then the space after, then find the | and insert the right indent tab after.

                                     

                                    Find:

                                    (.+)(\|)

                                     

                                    Change to:

                                    \t$1~>$2~y

                                    • 15. Re: Find/Change command! Me again!
                                      Peter Spier Most Valuable Participant (Moderator)

                                      The website seems to be down at the moment so I can't log in, but hopefully this is going to make it by email.

                                       

                                      First, you need to set either a character-aligned tab or a right-aligned tab where you want the | to appear in your cell. Next it seems we need to explicitily put the first tab into the string, as well as the right indent tab, so we need to find all the text leading up to the | and put a tab in front of it, then the space after, then find the | and insert the right indent tab after.

                                       

                                      Find:

                                      (.+)(\|)

                                       

                                      Change to:

                                      \t$1>$2y

                                      • 16. Re: Find/Change command! Me again!
                                        Kirikokos Level 1

                                        Hi Peter,

                                         

                                        I don't get this..

                                        Can you maybe write a step by step guide?:)

                                         

                                        First, you need to set either a character-aligned tab or a right-aligned tab where you want the | to appear in your cell.

                                        How? (there are so many ways I think.. )

                                         

                                        Next it seems we need to explicitily put the first tab into the string, as well as the right indent tab, so we need to find all the text leading up to the | and put a tab in front of it,

                                        How?

                                         

                                        then the space after, then find the | and insert the right indent tab after.

                                        How?

                                         

                                        thanks

                                        • 17. Re: Find/Change command! Me again!
                                          Peter Spier Most Valuable Participant (Moderator)

                                          Sorry for the confusion.

                                           

                                          First, you need to set either a character-aligned tab or a right-aligned tab where you want the | to appear in your cell.

                                          You do this by setting the tab position in the paragraph style assigned to the text in the cells. Once that tab is set, your | will appear at that position when we are done.

                                           

                                          Next it seems we need to explicitily put the first tab into the string, as well as the right indent tab, so we need to find all the text leading up to the | and put a tab in front of it, then the space after, then find the | and insert the right indent tab after.

                                           

                                          If you have an empty cell and tab into it and start typing, your text will use any tab character that is set in the paragraph style, but you don't have that situation, so it's necessary to add the initial tab to your existing text string as well as to add the spaces around the | and get the second number right aligned. You do that in one operation using the GREP query (which looks like it didn't come through well) from above:

                                           

                                          Find (.+)(\|)

                                           

                                          the (.+) finds anything, and in this case the would find the entire contents of the cell, except that it's followed by the (\|) which finds the | cahracter, so you are finding first the text before the |, then the | itself.

                                           

                                          Change \t$1~>$2~y  (in case the form messes it up again, that's "dollar sign 1 tilde "greater than sign" [from over the period on the keyboard] dollar sign 2 tilde y")

                                           

                                          \t is the tab character that needs to be in fron to the first set of numbers to align the |. $1 is the wildcard for the reult of waht was found by the expression in the fisrt set of parentheses (your first number). ~> (tilde greater than) is an en-space to use as a separator (you  can use a differnt space here). $2 is the result of the search expression inthe second set of parentheses, the |. ~y (tilde y) is the right-indent tab used to right align the second number in the cell.

                                          • 18. Re: Find/Change command! Me again!
                                            Kirikokos Level 1

                                            Yes! It works.. perfect! Thanks a lot!!