batch find and replace non-breaking spaces and hyphens
Thread poster: Bruno Depascale

Bruno Depascale  Identity Verified
Italy
Local time: 12:44
Member (2009)
English to Italian
+ ...
Jun 22

Hi everybody,
I'd like to ask your help about a really time-consuming process in trados studio.
I often have to replace normal spaces with non-breaking spaces before the units of measure (like for example 10 mg).
Is there a way to do this via the search and replace function?
The same applies also to non-breaking hyphens, since if I paste a non-breaking hyphen in the search and replace box, trados automatically changes it to a normal hyphen.
Thank you for your help!


Direct link Reply with quote
 
_stephan  Identity Verified
Germany
Local time: 12:44
English to German
Works in 2017 Jun 22

Hi Bruno,

I just tried this using Studio 2017 because I was fairly certain this should work, and as far as I can see it does:

I pasted a non-breaking space and non-breaking hyphen into the 'replace with' box and, while it's not discernible in the search dialog, it's definitely replacing with the correct characters.

When I type a non-breaking hyphen in the Studio editor (via ctrl+shift+hyphen), it appears as a purple tag. The replaced character looks like a regular hyphen, so I double-checked in the target file in Word and it really is non-breaking.


For pre-translation/auto-propagation you can also control this via the project settings:
Language Pairs -> (your language pair) -> Translation Memory and Automated Translation -> Auto-substitution -> Measurements

Does that help you?

Stephan


Direct link Reply with quote
 

NeoAtlas
Spain
Local time: 12:44
English to Spanish
+ ...
Some regex… Jun 23

About the non-breakable space, you can use this string in the Find what box:
(\d)[followed by a space]

and this string in the Replace with box:
$1[followed by non-breakable space, i.e., ALT+0160]

Note: Texts in brackets and square brackets themselves ([])are just descricriptive. You have to remove them and replace them with spaces that I can't show here.

Tick Use and select Regular expressions.

The press the Replace button for each instance with wish to get replaced.

Of course, you can try with other search and replace patterns, like:
Find what: (\d) (mg)
Replace with: $1[ALT+0160]$2

I hope this helps you,

… Jesús Prieto …


Direct link Reply with quote
 

Bruno Depascale  Identity Verified
Italy
Local time: 12:44
Member (2009)
English to Italian
+ ...
TOPIC STARTER
it works Jun 23

Thank you Jesús and Stephan, your answers have been very helpful!
Have a great day!


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

batch find and replace non-breaking spaces and hyphens

Advanced search







SDL MultiTerm 2017
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2017 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2017 you can automatically create term lists from your existing documentation to save time.

More info »
LSP.expert
You’re a freelance translator? LSP.expert helps you manage your daily translation jobs. It’s easy, fast and secure.

How about you start tracking translation jobs and sending invoices in minutes? You can also manage your clients and generate reports about your business activities. So you always keep a clear view on your planning, AND you get a free 30 day trial period!

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search