diff options
author | francis <francis> | 2008-04-14 23:18:33 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-14 23:18:33 +0000 |
commit | 34db79cb59dfa7c027d7f7293578985f9a6435a4 (patch) | |
tree | b0932b0dbf12470a27c230199b0cdd5196765464 | |
parent | 35080e76c5a880fa3795e95d22489b73bd70ff89 (diff) |
'Doh
-rw-r--r-- | app/models/incoming_message.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 3abf38f3f..5de247a20 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -17,7 +17,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: incoming_message.rb,v 1.75 2008-04-14 23:12:36 francis Exp $ +# $Id: incoming_message.rb,v 1.76 2008-04-14 23:18:33 francis Exp $ # TODO @@ -434,14 +434,14 @@ class IncomingMessage < ActiveRecord::Base File.unlink(tempfile.path + ".txt") tempfile.close elsif attachment.content_type == 'application/msexcel' - # Bit crazy using catdoc - but xls2csv, xlhtml and py_xls2txt + # Bit crazy using strings - but xls2csv, xlhtml and py_xls2txt # only extract text from cells, not from floating notes. catdoc # may be fooled by weird character sets, but will probably do for # UK FOI requests. tempfile = Tempfile.new('foixls') tempfile.print attachment.body tempfile.flush - IO.popen("/usr/bin/catdoc " + tempfile.path, "r") do |child| + IO.popen("/usr/bin/strings " + tempfile.path, "r") do |child| text += child.read() + "\n\n" end tempfile.close |