Start a new topic

Numbers: How to adapt to target rules?

 Hi,

I have hundred of numbers like that in a file:


I need to replace the comma with a non breaking space. Can CT do it automatically? Or maybe with some clever search-replace?


Regex. But I need more information: Always one number like above in a row, and none in a row with text? In that case, filter on Rows with no letters, replace comma with non-breaking space, move all tags to end. In other cases, it'll get a bit more complicated.


H.

I see, but... even if I launch Find-Replace lile below with a filter on Rows with no letters, CT applies it to all segments...


 

It shouldn't (I think), but if it does, you may want to try to replace <x1/>,<x2/> with <x1/>

[non-breakable space]<x2/>


H.

Hello,


If you wish to perform Find & Replace on the filtered results only, please select Multiple filter box in the Find & Replace dialog.

Thanks Igor, it works... but then I have a new problem:


 Target segments like 5,16 must stay as they are!

Alain: Target segments like 5,16 must stay as they are!


Make up your mind! Yet another example why I am against S/R All and regexes.

H.

So what´s is the actual numerical pattern for those segments to be replaced?

> Make up your mind! Yet another example why I am against S/R All and regexes.


Do you see any other alternative than regular expressions to make complex/advanced text searches? It looks like all the word processors and editors include the reg. ex. search option.

Woorden: Make up your mind!

You miss the point. I couldn't know beforehand that . would automatically be replaced with , by CT (which is perfectly correct indeed for the French target... in normal cases).

IK: Do you see any other alternative than regular expressions to make complex/advanced text searches?


No, I don't, which is why I mentioned regexes in my first reply. It's just that I'm convinced they're not for everybody, especially not for linguists who aren't mathematically inclined. Almost all of us.


H.

Alain: You miss the point. I couldn't know beforehand that...


You miss the point. You cannot automate anything unless you know beforehand that...


H.

I finally got it.
  • Filter on segments with no letters.
  • Replace . in source with zzz.
  • Then I can do as Igor said above.
  • Then I remove target with identical source and segment
  • The CT will convert numbers like 5.16 to 5,16



 

For those who didn't follow my poor explanation... All I did was to add letters (an impossible combination of letters like zzz) to the source segments that contained numbers with periods.... so I could refilter on segments without letters and apply Igor's solution only to segments that contained numbers with commas. Not quite mathematical, but it worked. ;-)
Woorden: You miss the point.

Yes, I agree. And thanks for the help above, you could'nt know
about the mysterious Multiple filter option that completed your proposed solution. ;-)
Login to post a comment