Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

place tabs after numbers but …

Return to Member Forum

  • Author
    Posts
    • #99202
      Alex Songe
      Participant

      I work for a newspaper and we use BLOX, which allows little formating to files, so tabulating material emailed to us and then put in BLOX is a pain. Once I move the copy to Indesign, I do a search for a space and then turn it into a tab, this takes forever because I don’t won’t to change all the spaces to tabs.. I wanted to see if a GREP expression can be created that inserts a tab in front of every number, but not after a number that is followed by a period, comma, or close parentheses. I currently would like to use this for a high school football poll. Here are what a few lines would look like:

      First-place votes in parentheses
      Rec. pts prv
      1. John Curtis (8) 120 1
      2, Rummel (2) 115 2
      3, St. Augustine 99 3
      4, Karr 88 6

    • #99209
      Graham Park
      Member

      If the text is all formatted with a number followed by a full-stop then use this GREP.

      Find
      ^(\d+.)
      Replace
      $1

      Your sample has commas and full-stops so you would need to use
      Find
      ^(\d+(.|,))

    • #99210
      Graham Park
      Member

      Sorry the space did not paste

      Your sample has commas and full-stops so you would need to use
      Find
      ^(\d+(.|,))

    • #99216

      Graham, I’m pretty sure, he needs some more tabs :)


      @Alex
      : Please provide a example where we can see, where your tabs must be inserted. It isn’t clear to me, if you need a tab at the start and before the open parentheses.

    • #99217
      Graham Park
      Member

      Kai
      You are right if Alex wants to replace the spaces with Tabs then a few GREP or a script will be needed.
      This sequence work for the example he posted, I also had it add two Tabs where there is no number in parentheses so the following numbers will line up.
      I’m sure someone can simplify this.

      Find (\)||\d)()(\d)
      Replace $1$3

      Find ()(?)(\(|)(\d
      Replace $1$3$4

    • #99222
      Alex Songe
      Participant

      One thing I forgot is team records and that involves more numbers and punctuation, so here is revised sample.. First-place votes in parentheses
      Rec. pts prv
      1, John Curtis (8) tab 8-0 tab 120 tab 1
      2, Rummel (2) tab 6-2 tab 115 tab 2
      3, St. Augustine tab 5-3 3tab 99 tab 3
      4, Karr tab 88 tab 6-2 tab 6

    • #99223
      Graham Park
      Member

      ALex
      The first GREP work except for example
      Only the 5.3 3 that you have in there does not work as there is no way pattern to this part. Is this an error in your example?

      (Also my second expression was missing a closing parenthesis which stopped it working but you don’t need this one)

Viewing 6 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads