View Single Post
Old 05-21-2015, 10:39 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The linux `file` command tests files for file content, and does not look at the file extension. It will correctly identify an RTF misnamed as a DOC.

You could use that command in Cygwin on Windows, or ... quickly googles ... awesome, gnuwin32 has a native windows binary here: http://gnuwin32.sourceforge.net/packages/file.htm

Should be simple to write a batch script to test the output (e.g. "sample.doc: Rich Text Format data, version 1, ANSI") and if it matches RTF, then do a `ren sample.doc sample.rtf`.
eschwartz is offline   Reply With Quote