Q: Pages and Terminal output different results of word count
If pass my .rtf file to wc -w command, it returns me the figure of 6909 words, whereas the words counter of Apple's Pages shows 2617 ones. Why?
Mac OS X (10.7.5), MacBook Pro 15.4 mid-2012
Posted on Apr 29, 2016 3:42 PM
Because you are passing the raw RTF syntax in that document to wc, and Pages is showing only the actual words in your document. The RTF control words permeate throughout that .rtf document. Here is an example:
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210
{\fonttbl\f0\fnil\fcharset0 Baskerville;}
{\colortbl;\red255\green255\blue255;\red26\green26\blue26;\red164\green8\blue0;}
\margl1440\margr1440\vieww8820\viewh17160\viewkind0
\deftab720
\pard\pardeftab720\sa200\pardirnatural
{\header \pard\ql\b\f0\fs28 [ zig.rtf ] \par}
\f0\fs38 \cf2 Lorem ipsum dolor sit amet, ligula suspendisse nulla pretium, rhoncus tempor placerat fermentum, enim integer ad vestibulum volutpat. Nisl rhoncus turpis est, vel elit, congue wisi enim nunc ultricies sit, magna tincidunt. Maecenas aliquam maecenas \cf0 ligula\cf2 \cf0 nostra\cf2 , accumsan taciti. Sociis mauris in integer, a dolor netus non dui aliquet, sagittis felis sodales, dolor sociis mauris, vel eu libero cras. Interdum at. Eget habitasse elementum est, ipsum purus pede porttitor class, ut adipiscing, aliquet sed auctor, imperdiet arcu per diam dapibus libero duis. Enim eros in vel, volutpat nec pellentesque leo, {\field{\*\fldinst{HYPERLINK "http://www.hp.com"}}{\fldrslt temporibus}} scelerisque \cf3 nec\cf2 .\
and this is the text that Pages '09 shows you:
Posted on Apr 29, 2016 7:45 PM

