Sha256: afbb8a9bb279fddf4c9d09b84b75728940b4040e83d3b8b36b6cb73e152df76f

Contents?: true

Size: 597 Bytes

Versions: 21

Compression:

Stored size: 597 Bytes

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))

require 'msworddoc-extractor'
require 'optparse'

def program_name
  File.basename(File.expand_path(__FILE__))
end

OptionParser.new do |opts|
  opts.banner = "Usage: #{program_name} [options] file"

  opts.on('-h', '--help', 'Prints this help') do
    puts opts
    exit
  end
end.parse!

filename = ARGV[0]
extension = File.extname(filename)
raise 'This text extractor currently only works for .doc files' unless extension == '.doc'

doc = MSWordDoc::Extractor.load(filename)

puts doc.whole_contents

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ndr_import-8.5.1 exe/word_to_text