When a translator has an order for many documents at once, at the end there is a common problem. We have many documents and must calculate their characters count one after another, which may take a long time, when we speak about many small docs.

So I’ve written a small bash script to help calculate the character, page count and fee just for few seconds.

Basicly it does the fallowing:

  • Takes all documents (OpenOffice/LibreOffice/Word) from a folder and converts them to text files with the help of catdoc for doc files and odt2txt for txt files;
  • Counts the characters for every document with the wc command. If the -r param is given, it would round the char count for all documents, smaller than a standard page to a standard page’s char count;
  • Outputs the character and pages count. The standard page defaults to 1800 chars, but may be chanded;
  • If price per page given, it outputs the calculated fee as well;
  • At the end the script removes all unnecessary txt files.

If you want, you may put the script into /home/$USER/bin without the .sh extension and it will be exposed to your PATH, so you can just call masscounter from the terminal. Before that type $PATH in the terminal to check if /home/$USER/bin is already there. Remember, that your user needs rights to execute the script!

The exact usage is described in the help.

Just type masscount -h and read the fine documentation :)

Download: masscounter

Happy hacking!

Вашият коментар