Code Monkey home page Code Monkey logo

Comments (14)

jjesusfilho avatar jjesusfilho commented on May 28, 2024 1

from textreadr.

trinker avatar trinker commented on May 28, 2024

What does this give you:

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

from textreadr.

jjesusfilho avatar jjesusfilho commented on May 28, 2024

from textreadr.

trinker avatar trinker commented on May 28, 2024

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")

from textreadr.

jjesusfilho avatar jjesusfilho commented on May 28, 2024

from textreadr.

trinker avatar trinker commented on May 28, 2024

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

from textreadr.

jjesusfilho avatar jjesusfilho commented on May 28, 2024

from textreadr.

trinker avatar trinker commented on May 28, 2024

from textreadr.

trinker avatar trinker commented on May 28, 2024

One more part can you run:

file.exists(antiword_loc())

from textreadr.

jjesusfilho avatar jjesusfilho commented on May 28, 2024

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

from textreadr.

trinker avatar trinker commented on May 28, 2024

@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.

from textreadr.

jjesusfilho avatar jjesusfilho commented on May 28, 2024

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.

from textreadr.

trinker avatar trinker commented on May 28, 2024

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

from textreadr.

trinker avatar trinker commented on May 28, 2024

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

from textreadr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.