Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_antiword_installed doesn't find antiword #5

Closed
jjesusfilho opened this issue Apr 17, 2017 · 14 comments
Closed

check_antiword_installed doesn't find antiword #5

jjesusfilho opened this issue Apr 17, 2017 · 14 comments

Comments

@jjesusfilho
Copy link

I manually downloaded antiword, but the command check_antiword_installed doesn't find it. I am using linux. If I type in command line "which antiword" I get the following response: usr/bin/antiword. But textreadr can't find it.

@trinker
Copy link
Owner

trinker commented Apr 17, 2017

What does this give you:

check_antiword_installed('usr/bin/antiword/antiword.exe')

@jjesusfilho
Copy link
Author

jjesusfilho commented Apr 17, 2017 via email

@trinker
Copy link
Owner

trinker commented Apr 18, 2017

There are some Windows based checks that need to be extended. I will utilize Unix approaches conditionally. Can you try the following:

Sys.which("antiword")

@jjesusfilho
Copy link
Author

jjesusfilho commented Apr 18, 2017 via email

@trinker
Copy link
Owner

trinker commented Apr 18, 2017

Thank you for that. Can you tell me what this gives:

antiword_loc <- function(){

    myPaths <- c("antiword", "~/.cabal/bin/antiword", "~/Library/Haskell/bin/antiword",
        "C:\\PROGRA~1\\antiword\\antiword.exe", "/usr/bin/antiword",
        "/Applications/antiword.app/Contents/MacOS/antiword", 
        file.path(strsplit(getwd(), "(/|\\\\)+")[[1]][1], 'antiword/antiword.exe'))
    
    panloc <- Sys.which(myPaths)
    temp <- panloc[panloc != ""]

    short.path <- which.min(unlist(lapply(gregexpr("[Aa]ntiword", temp), "[[", 1)))
    temp[short.path]
}

antiword_loc()

file.exists(antiword_loc())

And...to install antiword did you use sudo apt-get install antiword or did you download the tar ball, extract the contents, navigate to antiword directory and run:

make
sudo make install

@jjesusfilho
Copy link
Author

jjesusfilho commented Apr 18, 2017 via email

@trinker
Copy link
Owner

trinker commented Apr 18, 2017 via email

@jjesusfilho
Copy link
Author

jjesusfilho commented Apr 18, 2017 via email

@trinker
Copy link
Owner

trinker commented Apr 18, 2017

One more part can you run:

file.exists(antiword_loc())

@jjesusfilho
Copy link
Author

file.exists(antiword_loc())
[1] TRUE

trinker added a commit that referenced this issue Apr 19, 2017
…orks on

  Windows, Linux, and Mac.  Thanks to José de Jesus Filho for catching this and
  working through the process on Linux (see issue #5).
@trinker
Copy link
Owner

trinker commented Apr 19, 2017

@jjesusfilho can you try reinstalling the dev version

library(devtools)
install_github('trinker/textreadr')
library(textreadr)

...and try the following:

check_antiword_installed()
check_antiword_installed('usr/bin/antiword')

x <- system.file("docs/Yasmine_Interview_Transcript.doc", package = "textreadr")
read_doc(x)

Hopefully, we can close this if all checks out.

@jjesusfilho
Copy link
Author

When I run:
check_antiword_installed()

I get:
checking if antiword is installed...

antiword appears to be installed.

...Let the .doc extraction begin!

But when I run:

check_antiword_installed('usr/bin/antiword')
I get:

checking if antiword is installed...

Error in install_anitword_linux() :
Antiword must be installed first. Please install first:

sudo apt-get install antiword

Anyway, It's working now and I was able to read all my doc texts.

Thank you very much. By the way, I love your packages and I have promoted them in the Brazilian R community.

Cheers.

@trinker
Copy link
Owner

trinker commented Apr 19, 2017

Thank you very much. Your support and word of mouth advertisement are greatly appreciated.

Can you try one last thing. I think I know the original problem with the path. Try:

check_antiword_installed('/usr/bin/antiword')

I believe it needs a leading slash on Linux. I have added your contribution to the NEWS file as well: https://github.com/trinker/textreadr/blob/master/NEWS

@trinker
Copy link
Owner

trinker commented Apr 20, 2017

I got Linux up and running and confirm it was the leading slash. I'm closing this.

@trinker trinker closed this as completed Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants