You must be logged in to post Login

Search Forums:


 






GREP put "$" on first price in a story.

UserPost

9:44 am
August 20, 2010


rydesign

Member

posts 51

Stuggling with this one and have tried and tried ot come up with a solution using grep… I am not sure it can be done.  I have a bunch of stories with prices in them.  I only want the first price in the story to have a "$". Also if the story threads to another story I would like the top price in that story to aslo have a $.  Also making my life more complicated is that this first line holds and anchored object for the picture of this item.


Have a whole catalog full of these that sometimes the "$" get missed.  Sometimes They get put on another line too.  I would like to just remove all the "$" and replace them using grep. Right now I am manually looking for these.  There is probally a better way. 


Everything I have tried hasn't worked.  Jongware..?  Honestly can anyone help.  Although Jongware deserves a metal or to get paid for helping everyone on just about every post.


Example

A~a\t225/55\tR-\t16\t $84\r

        \t235/65\tR-\t16\t   88\r   

        \t245/75\tR-\t16\t   90\r   

        \t235/85\tR-\t17\t 104\r   

9:44 am
August 20, 2010


rydesign

Member

posts 51

I guess technically the last one would be Z.  that also creates frustration.

9:45 am
August 20, 2010


rydesign

Member

posts 51

\Z

9:45 am
August 20, 2010


rydesign

Member

posts 51

and the first one would start with "\A"

2:09 pm
August 20, 2010


Jongware

Member

posts 694

Thanks for the honourable mention, but I do think you're out of luck here …

\A\d will find the first number in your story (i.e., one without a dollar sign before it) but GREP cannot discern frames. That is, \A (and \Z) will not match the first (or last) character per frame (much like GREP cannot 'see' the individual lines per paragraph).

You are also correct in your observation that anchored objects make things even more complicated — I've seen anchors move around and disappear when I tried to manipulate the text around them with GREP.


I think it's safest to remove all dollar signs using the regular Find-and-Change (GREP sometimes has problems with \$, and you don't need a specialized GREP search to remove them either) and then just manually page through your document and insert them by hand where needed … :(

8:29 am
August 23, 2010


rydesign

Member

posts 51

Yeah… I was afraid you would say that.  :)   oh well I guess i have to just adjust my proofing eyes and stop missing these simple mistakes.

8:29 am
August 23, 2010


rydesign

Member

posts 51

Yeah… I was afraid you would say that.  :)   oh well I guess i have to just adjust my proofing eyes and stop missing these simple mistakes.