1 person found this helpful
Not that I'm aware of, but you could run a Find/Change on the entire document to quickly apply the asterisk character in those positions.
If you have a paragraph style applied to barcode you can ensure the changes only occur to the text that has that particular paragraph style applied to it. Let's assume you have a paragraph style named barcode. Here's how to perform a Find/Change limited to that paragraph style:
- Choose File > Change.
- Click the GREP tab at the top of the panel.
- Click More Options to see the expanded version of the Find/Change dialog box.
- To the right of Find What, click the Special Characters for Search menu, and select Symbols > Open Bracket Character. This adds the text \[ to the Find What field
- To the right of Change To, click the Special Characters for Search menu, and select Found > Found Text, this adds $0 to the Change To field.
- AFTER the $0 add the * symbol.
- Click the Specify Attributes To Find icon on the right of Find Format.
- Select the style you applied to the barcode text from the Paragraph Style menu in the Find Format Settings dialog box. Click OK.
- Back in the Find/Change dialog box, Click Change All to perform the change to all the barcodes.
- If you work on catalogues regularly you might want to save the query for future use. Click the Save Query icon at the top of the panel, and name the query, you can now same query this by selecting it from the Query menu at any time in the future.
- REPEAT steps 4-10 for the Close Bracket. In step 4 select Close Bracket Character and in step 6, place the * before the $0.
With the start it is possible: Create a numbered list, but don't use any number, only the text you want to have at the beginning (and use a specific list to not to confuse normal numbers).
With the end normally not automatically, use above workaround. I know and use once a solution, but it is way to complicated for normal users, as it involves installation of RTL versions and it causes other problems if you are not familiar with it.
I think Obi-wan's string is better than Cari's, but neither one accounts for a case where there is already one of the asterisks, or if the code could contain something other than a digit. We could use some clarification from the OP as to whether that could ever happen, and if there is any way to isolate product numbers from other text in brackets, if that can ever occur, such as an applied style or position at the beginning or end of a paragraph.
Yours is the best, most detailed explanation so far, not just for me, but potentially for other users encountering similar cases. I don't understand Obi-Wan's "solution" (in French) which contains no explanation of the code, Willi's doesn't work for me (numbered lists won't play very nicely with dozens of separate tables) and Peter Spier is obviously addressing possible alternate cases (good) but that will never apply to me in this particular situation. Since my product catalog contains several tables, a global search and replace is the best solution.
However—it appears I am in luck—our customer is now using Excel to automatically add the asterisks to an additional (duplicate) column of product codes adjacent to the regularly (alphanumeric) formatted product codes, which means all I have to do now is apply the paragraph styles to the new column
Your most welcome. Glad that was helpful.
Client supplying the code with asterisk included even better!
No comment! [in English]
Sans commentaire ! [en Français]
Je suis désolé!
Pas de quoi !
Pour ce qui est de la fourniture par ton client d'une version "asterisk", même si elle ne lui prend qu'une minute pour le faire [2e colonne créée avec une formule concaténée dans Excel], c'est un travail totalement inutile, qu'il apprécierait sûrement de ne pas faire s'il sait qu'il te faudra moins de temps encore pour recopier la regex suivante et régler la question !
… Mais j'oubliais : tu ne parles pas Français !
"Entia non sunt multiplicanda praeter necessitatem." … Tu ne parles peut-être pas latin non plus !