ProZ.com global directory of translation services
 The translation workplace
Ideas

 
Pages in topic:   < [1 2]
User
Thread poster: Nurzhan Nagashbekov
Counting words in a txt file within quotation marks

Samuel Murray  Identity Verified
Netherlands
Local time: 04:22
Member (2006)
English to Afrikaans
+ ...
The grumpy old MS Word user method Feb 9


Nurzhan Nagashbekov wrote:
#command some text "text to be localized" // comment


I'll assume for now that there are no multi-line segments (though that is not an impossible problem).

1. Open the file in a text editor, and copy/paste it into MS Word, and save it as a Word file.
2. Figure out how quotation marks within the quoted text is escaped (e.g. it is doubled up like ""this"" or it may be escaped with a slash like \"this\"). Replace those with something unique eg. "@@@".
3. Select all text in MS Word and highlight it (e.g. yellow).
4. Global replace ^l with ^p.
5. Global replace ^p (highlighted) with ^p (not highlighted) (ask if you don't know how to do that).

This means that every segment is highlighted but is delimited by some text that is not highlighted (i.e. the paragraph mark). This is so that you can restrict MS Word's regex find/replace to within the segments -- if you tell MS Word to process only highlighted text, it will not do the regex matching across multiple segments because segments are delimited by non-highlighted text.

6. Do this find/replace with wild cards:
Find: \"*\"
Replace: (nothing) (formatted as "Not highlighted").

Now all translatable text is not highlighted. Delete all highlighted text, and count what's left.


Direct link Reply with quote
 
Pages in topic:   < [1 2]


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

Moderator(s) of this forum
Catherine Piéret[Call to this topic]
Maria Castro[Call to this topic]

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

Counting words in a txt file within quotation marks







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 »
Fluency Translation Suite 2011
Translate Up To 50% Faster with Fluency

Start and finish your translations faster than ever with Fluency Translation Suite 2011. TMs, Terminology, and Online Resources are all fully integrated and only a click away. Download a free trial today!

More info »