Remove/replace line break tags (red "BR" tag)?
Thread poster: Jalapeno
Jalapeno
Jalapeno
Local time: 16:49
English to German
Feb 21, 2020

EDIT: I just found the solution while waiting for this posting to be approved. I'll leave this here for posterity. My mistake was leaving the box "Also search in tags" ticked in the Find+Replace dialog. When you untick this, you can use the RegEx \itag or \tag to replace the tags with spaces.

*******************

Hi everyone,

I have a memoQ file that is based on an Excel file. The Excel file had manual line breaks in it. These line breaks appear as red "BR"
... See more
EDIT: I just found the solution while waiting for this posting to be approved. I'll leave this here for posterity. My mistake was leaving the box "Also search in tags" ticked in the Find+Replace dialog. When you untick this, you can use the RegEx \itag or \tag to replace the tags with spaces.

*******************

Hi everyone,

I have a memoQ file that is based on an Excel file. The Excel file had manual line breaks in it. These line breaks appear as red "BR" tags in memoQ.

Large parts of the file have already been translated and are in the TM as 100% matches, but they all have the line breaks in the target segment. I want to remove these line breaks from the target segment and replace them with a space.

An example. The target segment looks like this:

All translatorsBRare great people.

I want it to look like this:

All translators are great people.

Is there any quick way to do this so I don't have to manually go into every segment and use the "Delete" / "Backspace" key to remove the tag?

I can use a Find+Replace operation to search for the RegEx \n and replace it with nothing. That removes the "BR", but it leaves me with an empty red tag.

I can use "Remove all tags" / Ctrl+F8 to remove the tags entirely, but that leaves me without a space, so I end up with All translatorsare great people.

Oh, and I can't reimport the file into memoQ to get rid of the tags in the first place (plus, the translations stored in the TM all have the tags in them). And I can't remove them in the Excel file before delivery, because I have to deliver the memoQ file.

Thanks for any help

J

[Edited at 2020-02-21 18:37 GMT]
Collapse


 
Jan Truper
Jan Truper  Identity Verified
Germany
Local time: 16:49
Member (2016)
English to German
... Feb 6, 2023

Jalapeno wrote:

EDIT: My mistake was leaving the box "Also search in tags" ticked in the Find+Replace dialog. When you untick this, you can use the RegEx \itag or \tag to replace the tags with spaces.


Hi, can someone elaborate on how to do this?

I want to replace a bunch of n-break-tags (\n) with spaces in the target segments.
There are various other tags in the text, which need to stay unharmed


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 17:49
English to Russian
Search within tags as well Feb 6, 2023

You can avoid <br> tags by importing your file with options and unchecking the box called 'Import linebreaks as inline tags'.

Now that you have tags already inserted in your translation, you can replace \n in regex mode. For that, you need to check the 'Target text' and '
... See more
You can avoid <br> tags by importing your file with options and unchecking the box called 'Import linebreaks as inline tags'.

Now that you have tags already inserted in your translation, you can replace \n in regex mode. For that, you need to check the 'Target text' and 'Search within tags as well' boxes.

[Edited at 2023-02-06 12:29 GMT]
Collapse


 
Jan Truper
Jan Truper  Identity Verified
Germany
Local time: 16:49
Member (2016)
English to German
... Feb 6, 2023

Stepan Konev wrote:

You can avoid
tags by importing your file with options and unchecking the box called 'Import linebreaks as inline tags'.

Now that you have tags already inserted in your translation, you can replace \n in regex mode. For that, you need to check the 'Target text' and 'Search within tags as well' boxes.

[Edited at 2023-02-06 12:24 GMT]


The file was imported by the client, so I have to deal with what I have.

Yes, with "Search within tags" I am able to find and highlight all occurrences of "\n" -- but when I replace them with a space, the result is a tag with a space inside. I want the tag gone. I just want the space.


 
Jalapeno
Jalapeno
Local time: 16:49
English to German
TOPIC STARTER
Solution if \n is *only* type of tag in the file Feb 6, 2023

If the \n tag is the *only* type of tag in your file, it's easy:

1. Ctrl-H to open the search-and-replace window.
2. Make sure "Also search in tags" is unchecked.
3. Alt-X to activate regex search (alternatively, click the regex icon in the top right of the search-and-replace window).
4. Enter \itag under "search" and a space under "replace".
5. Alt-A to replace all (alternatively, click the "replace all" icon in the bottom right of the search-and-replace win
... See more
If the \n tag is the *only* type of tag in your file, it's easy:

1. Ctrl-H to open the search-and-replace window.
2. Make sure "Also search in tags" is unchecked.
3. Alt-X to activate regex search (alternatively, click the regex icon in the top right of the search-and-replace window).
4. Enter \itag under "search" and a space under "replace".
5. Alt-A to replace all (alternatively, click the "replace all" icon in the bottom right of the search-and-replace window).


If there are other types of tags in your file apart from the \n tag, I can't think of a solution.
Collapse


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 17:49
English to Russian
\itag = any inline tag Feb 6, 2023

Jalapeno wrote:
4. Enter \itag under "search" and a space under "replace".
If it was so easy... This regex includes all inline tags like <tab>, etc. If you replace all \itag with white spaces, all tabulators will convert into spaces too. According to the memoQ documentation, memoQ can only replace three regular expressions for tags: \tag, \itag and \mtag. That's it.


 
Jalapeno
Jalapeno
Local time: 16:49
English to German
TOPIC STARTER
Yup Feb 6, 2023

Which is why I said "only works if \n tags are the only type of tag in the file".

Jan Truper
 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 17:49
English to Russian
Workaround Feb 6, 2023

You can replace all line breaks with white spaces directly in Excel. Once you are done with your translation, export it as is, open and press Ctrl+H to invoke the F&R window. Put the cursor into the 'Find what' text field and press Ctrl+J. Then put the cursor into the 'Replace with' field and press the spacebar. Replace all.

[Edited at 2023-02-06 15:45 GMT]


 
Jan Truper
Jan Truper  Identity Verified
Germany
Local time: 16:49
Member (2016)
English to German
... Feb 6, 2023

Stepan Konev wrote:

You can replace all line breaks with white spaces directly in Excel. Once you have done with your translation, export it as is, open and press Ctrl+H to invoke the F&R window. Put the cursor in to the 'Find what' text field and press Ctrl+J. Then put the cursor into the 'Replace with' field and press the spacebar. Replace all.


Thank you -- but I want them gone while I'm working in memoQ.


 
Jalapeno
Jalapeno
Local time: 16:49
English to German
TOPIC STARTER
Workaround won't work ... Feb 6, 2023

I'm fairly certain the workaround won't work, as Jan Truper doesn't have access to the original file. The client has imported it into memoQ and Jan can only work in memoQ and has to deliver in memoQ.

 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 17:49
English to Russian
Sure Feb 6, 2023

Jan Truper wrote:
Thank you -- but I want them gone while I'm working in memoQ.
Right, I clearly understand that. That is exactly why I first said it is not possible with memoQ and only then suggested a workaround.


Jan Truper
 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 17:49
English to Russian
tw4winInternal Feb 6, 2023

Jalapeno wrote:
I'm fairly certain the workaround won't work, as Jan Truper doesn't have access to the original file. The client has imported it into memoQ and Jan can only work in memoQ and has to deliver in memoQ.
That is why I call it a workaround but not a solution. Actually the problem is the tw4winInternal style. I tried to export my file into a Trados-compatible format and replace those tags from there. You can replace the unhidden/tw4winInternal <mq:ch val="&#13;&#10;"/> tag with a space char, but even when I set Normal style for the 'Replace with' field, the tw4winInternal survives as if it has a magic shield. If anybody knows how to change the unhidden tw4winInternal style with Normal, then you can resolve the issue. When I changed the style manually by copying (Ctrl+Shift+C / Ctrl+Shift+V) and then imported the file to memoQ again (updated), the tags were gone.


 
Jan Truper
Jan Truper  Identity Verified
Germany
Local time: 16:49
Member (2016)
English to German
... Feb 24, 2023

After some futzing, I found a solution for my specific problem (replacing line break tags with a space, while leaving all other tags intact and in place):

1)
in memoQ's Advanced Find And Replace, regex mode
enter "mq:ch" (without the quotes) in the Find field

search in target text, search within tags as well

Replace with nothing

that will get rid of the tag shape and put this strange looking construction in the target text field (ap
... See more
After some futzing, I found a solution for my specific problem (replacing line break tags with a space, while leaving all other tags intact and in place):

1)
in memoQ's Advanced Find And Replace, regex mode
enter "mq:ch" (without the quotes) in the Find field

search in target text, search within tags as well

Replace with nothing

that will get rid of the tag shape and put this strange looking construction in the target text field (apparently the line break is still in there):

< val="
"/>

2)
Copy-paste this into the Find field

Replace with a space





[Edited at 2023-02-24 09:38 GMT]
Collapse


 


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


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

Remove/replace line break tags (red "BR" tag)?






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 »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »