Wildcards in Word Auteur du fil: Emma Goldsmith
| Emma Goldsmith Espagne Local time: 02:15 Membre (2004) espagnol vers anglais
I'm stuck (again) trying to figure out how to use wildcards to replace commas with periods in this sort of string in Word: 5,34E-03 -6,32E-03 The comma is always followed by two digits and E, so in the find box I have put: ,[0-9]{2}E but I'm stuck on the replace box. I've tried .\1 but it doesn't work. Can anyone help me, please? | | | Rolf Keller Allemagne Local time: 02:15 anglais vers allemand Regular expressions in Word | Jun 25, 2012 |
Emma Goldsmith wrote: I'm stuck (again) trying to figure out how to use wildcards to replace commas with periods in this sort of string in Word: 5,34E-03 -6,32E-03 You have to use () in order to build two groups. Search: (,)([0-9]{2}E) Replace: .\2 | | | wotswot France Local time: 02:15 Membre (2011) français vers anglais Wildcard syntax | Jun 25, 2012 |
Find what: ,([0-9]{2})E Replace with: .\1E The \1 in the Replace refers to the first grouped expression in the Find (i.e. the expression surrounded by (round) brackets). You can have as many grouped expressions as you like, for instance: Find what: ([0-9]{2}),([0-9]{2}) % Replace with: \1.\2% should replace all French-format percentages with English-format ones. The main thing to bear in mind is that GROUPS are in brackets in... See more Find what: ,([0-9]{2})E Replace with: .\1E The \1 in the Replace refers to the first grouped expression in the Find (i.e. the expression surrounded by (round) brackets). You can have as many grouped expressions as you like, for instance: Find what: ([0-9]{2}),([0-9]{2}) % Replace with: \1.\2% should replace all French-format percentages with English-format ones. The main thing to bear in mind is that GROUPS are in brackets in the Find and referenced sequentially by \n in the Replace (where 'n' is the nth bracketed expression). ▲ Collapse | | | Emma Goldsmith Espagne Local time: 02:15 Membre (2004) espagnol vers anglais AUTEUR DU FIL
Thanks for your ideas, Rolf and wotswot. I'd completely forgotten about building groups with brackets. However, neither suggestion seems to work. In both cases the comma disappears, but the period is sent to the end of the string. i.e. 5,34E-03 becomes 534.E-03 (wotswot) and 534E.-03 (Rolf) Any more ideas?
[Edited at 2012-06-25 18:16 GMT] | |
|
|
wotswot France Local time: 02:15 Membre (2011) français vers anglais
Very odd. It works fine with me, in Word 2010 and 2003, what's your version? Try ([0-9),([0-9]{2})E in Find and \1.\2E in Replace. Does that work? Silly question no doubt, but are you sure you have 'Use wildcards' ticked and only that? | | | Rolf Keller Allemagne Local time: 02:15 anglais vers allemand
Emma Goldsmith wrote: neither suggestion seems to work. In both cases the comma disappears, but the period is sent to the end of the string. Strange. My proposal works for me. | | | Emma Goldsmith Espagne Local time: 02:15 Membre (2004) espagnol vers anglais AUTEUR DU FIL track changes | Jun 26, 2012 |
I tried your new suggestion, wotswot, and that didn't work either, so I continued to experiment, and I've just discovered all these options do work but not for text that is hidden when track changes is on. They work when track changes is on, and the text is unhidden, They work when track changes is off, and the text is hidden, But they don't work when TC and hidden text is used together So t... See more I tried your new suggestion, wotswot, and that didn't work either, so I continued to experiment, and I've just discovered all these options do work but not for text that is hidden when track changes is on. They work when track changes is on, and the text is unhidden, They work when track changes is off, and the text is hidden, But they don't work when TC and hidden text is used together So thank you, wotswot and Rolf. All of your ideas worked, but I will have to remove the hidden text format to do the F&R and then put it back in again afterwards. (Using Word 2010 prof 32-bit, by the way). Thanks again for your help, Emma Edited to add: Now the hidden text doesn't seem to be related. But I still have to take off tracked changes.
[Edited at 2012-06-26 10:31 GMT] ▲ Collapse | | | Oscar Martin Espagne Local time: 02:15 anglais vers espagnol + ... Wildcards in Word | Jun 26, 2012 |
Hi Emma, This search works fine. Activate the wildcards checkbox. Search: ([0-9]),([0-9]@E) Replace with: \1.\2 It will replace all numbers (with an E) containing comma with period. Regards, Oscar | |
|
|
Emma Goldsmith Espagne Local time: 02:15 Membre (2004) espagnol vers anglais AUTEUR DU FIL track changes again | Jun 27, 2012 |
Oscar Martin wrote: Search: ([0-9]),([0-9]@E) Replace with: \1.\2 Hi Oscar, Thanks for your suggestion. It works perfectly until I enable track changes and then, mysteriously 5,34E-03 gets replaced as follows: 534E.-03 Still, I am now disabling track changes as a workaround, so the issue is solved. Does anyone know if it is normal for wildcards not to work with track changes? Thanks, Emma | | | wotswot France Local time: 02:15 Membre (2011) français vers anglais
I find quite a few things don't work as expected when TC is on (spell-check not ignoring deletions, etc.). Anyway, translating with TC on is always messy. Do you really have to? | | | PAS Local time: 02:15 polonais vers anglais + ... Q&D solution (only if all numbers are close together) | Jun 27, 2012 |
If the numbers are all in a table, all you need to do is mark the column(s) containing the numbers, click ctrl+h (search & replace) replace the comma with the dot, click "replace all" and then click "no", when Word asks if to continue in the rest of the document. Another Q&D solution is to replace all ,1 with .1 ,2 with .2 all the way up to 9. It ain't pretty, but it works. | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Wildcards in Word Trados Business Manager Lite | Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.
More info » |
| Protemos translation business management system | Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |