How to count the characters inside a segment?
Thread poster: Nathalie Suteau (X)
Nathalie Suteau (X)
Nathalie Suteau (X)
United Kingdom
Local time: 01:07
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
Elif Baykara Narbay  Identity Verified
Türkiye
Local time: 04:07
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
Stepan Konev  Identity Verified
Russian Federation
Local time: 04:07
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 w
... See more
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: (\>)(*)(\<)
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 '>' and '<' 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]
Collapse


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

Step 2:
Invoke 'Find and Replace' again.

Find what: [><]
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]
Collapse


 
Nathalie Suteau (X)
Nathalie Suteau (X)
United Kingdom
Local time: 01:07
English to French
TOPIC STARTER
Thanks May 23, 2017

I will try your solution

 
Ben Senior
Ben Senior  Identity Verified
Germany
Local time: 02:07
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
Stepan Konev  Identity Verified
Russian Federation
Local time: 04:07
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
Ben Senior  Identity Verified
Germany
Local time: 02:07
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
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 04:07
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

dragking


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
-------------

Snapshot_2017-5-26_6-32-49


[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?







TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
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 »