Skip navigation
Klindse704
Currently Being Moderated

Adding GREP search to FindChangeByList script in CS4

Apr 12, 2012 7:34 PM

Tags: #cs4 #scripting #grep #indesign_cs4

I'm trying to remove numbers from a baseball box score pulled from the Internet.

The file has 10 numbers across separated by tabs and I only need six of the numbers not all 10

 

St. Lucie Mets

Player,Pos         AB     R     H     2B     3B     HR     RBI     BB     SO     AVG

Daniel Muno, 2B    4     1     1     0     0     1     1     0     2     .259

Robbie Shields, DH     4     0     2     1     0     0     0     0     1     .471

 

This GREP search works in FindChange in InCopy/InDesign (using CS4)

(\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)

 

This works in the Change field

$1 $2 $3 $7 $8 $9

 

 

However, when I try to add this to a FindChangeByList script, it generates an error. So my syntax, logic or both is flawed.

What should I do to fix it?

 

grep    {findWhat:"(\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d) (\t\d)"}    {changeTo:"$1 $2 $3 $7 $8 $9"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.

 

Thank you,

Keith

 
Replies
  • Currently Being Moderated
    Apr 13, 2012 1:36 AM   in reply to Klindse704

    Try again with all your single backslashes changed to double backslashes.

     

    .. I just checked the sample file; apparently, the only commands in there with backslashes are the ones that happen to not require them double. A Bad Example.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points