How to count the characters inside a segment?
Thread poster: Nathalie Suteau

Nathalie Suteau
United Kingdom
Local time: 03:38
English to French
May 22, 2017

Hello,

I have a subtitles project and I have to count the number of characters between various tags inside a segment. But Trados only gives the number of characters of the entire segment.

I'm doing the tedious manual task of copying and pasting each sentence between the tags to Word to see the number of characters.

Any suggestions to get faster?

Thanks a lot.


 

Elif Baykara Narbay  Identity Verified
Turkey
Local time: 05:38
German to Turkish
+ ...
So don't you have the number of characters already? May 22, 2017

Nathalie Suteau wrote:

But Trados only gives the number of characters of the entire segment.



 

Stepan Konev  Identity Verified
Russian Federation
Local time: 05:38
English to Russian
It is pretty complicated but you may want to try May 23, 2017

It takes 2 replacement steps (+ preparation for them) to complete your task. But if you have thousands of segments, it pays off. Read and follow carefully.

Preparation:
First, export your file for bilingual review (Review tab => Export for Bilingual Review).
Then open the file and copy one of the columns (depending on whether you want to count source or target) into another new Word document. All other columns are not needed for this purpose.
To select the whole column in one move, put the cursor so that it hovers over the uppermost line of the table. A black downward arrow will appear. Click LMB => copy => paste into a new docx. Make sure that formatting symbols are shown. Save the file for safety.

Step 1:
Select all, press Ctrl+Shift+H to hide all. The table will collapse here, but don't worry about it. You can either do it 'blindly' or drag the right vertical limit of the table to the right as far as you need to see the content.
Press Ctrl+H to invoke 'Find and Replace' window.
-----------------------------
Find what: (\&gt)(*)(\&lt)
Check the 'Use wildcards' option
When in 'Find what' field, press Format - Font - check 'Hidden' so that you see a tick mark.
-----------------------------
Replace with: \1\2\3
When in 'Replace with' field, press Format - Font - uncheck 'Hidden' so that it turns to 'Not Hidden'
-----------------------------

Replace all.
This makes all text between tags visible for the Word char-count system along with '&gt' and '&lt' marks. But you don't need these marks for count, do you. So go to step 2.

[Edited at 2017-05-23 19:04 GMT]


 

Stepan Konev  Identity Verified
Russian Federation
Local time: 05:38
English to Russian
Too long message – have to add another one May 23, 2017

Step 2:
Invoke 'Find and Replace' again.

Find what: [&gt&lt]
Use wildcards, Not Hidden
Replace with: _______ (DO NOT type anything in this field, it must be empty + when cursor is in 'Replace with' field, press the 'No Formatting' button)

Replace all.

Now press Ctrl+Shift+G in docx to see the statistics. This is exactly what you need.
For visual convenience, you can also remove all hidden text:
Find what: (*)
Use wildcards, Hidden
Replace with: _______ (empty field)

Now you only see the text that was between tags.

[Edited at 2017-05-23 18:59 GMT]


 

Nathalie Suteau
United Kingdom
Local time: 03:38
English to French
TOPIC STARTER
Thanks May 23, 2017

I will try your solution

 

Ben Senior  Identity Verified
Germany
Local time: 04:38
German to English
Less than and greater than symbos May 23, 2017

Stepan Konev wrote:
-----------------------------
Find what: (\greater than)(*)(\lower than) ........Please use relevant signs for 'greater than' and 'lower than' here. The forum code prevents me from putting them correctly.

@ Stepan,

If you want to use the less than and greater than symbols type "& L T" for < or "& G T" for >, obviously without the quotation marks and spaces.

Ben


 

Stepan Konev  Identity Verified
Russian Federation
Local time: 05:38
English to Russian
Never stop learning May 23, 2017

Ben Senior wrote:

If you want to use the less than and greater than symbols type "& L T" for < or "& G T" for >


Wow!
Thank you Ben.


 

Ben Senior  Identity Verified
Germany
Local time: 04:38
German to English
You are welcome May 24, 2017

Stepan Konev wrote:

Ben Senior wrote:

If you want to use the less than and greater than symbols type "& L T" for < or "& G T" for >


Wow!
Thank you Ben.


You are welcome Stepan, but I got the tip from Samuel Murray quite a while ago.


 

Selcuk Akyuz  Identity Verified
Turkey
Local time: 05:38
Member (2006)
English to Turkish
+ ...
DragKing May 26, 2017

I use DragKing, an AHK script for counting characters, words and lines. http://www.donationcoder.com/Software/Skrommel/#DragKing

nkqbe04npjmxv78qjt2j.jpg


You can also try a shorter AHK script

-------------
!c::
Send, ^c
ClipWait
Chars := StrLen(Clipboard)
RegExReplace(Clipboard,A_Space,"",Spaces)
MsgBox % "The highlighted text is " Chars " characters in length and contains " Spaces " spaces."
return
-------------

xjp7f1zxt9x2prafvlt4.jpg

[Edited at 2017-05-26 03:36 GMT]


 


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


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

How to count the characters inside a segment?

Advanced search







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

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »



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