search for: docx_summary

Displaying 12 results from an estimated 12 matches for "docx_summary".

2023 Dec 30
2
Help request: Parsing docx files for key words and appending to a spreadsheet
Hi Eric Thanks for that. That seems to fix one problem (the lack of a separator), but introduces a new one when I complete the function Calum proposed:Error in docx_summary() : argument "x" is missing, with no default The whole code so far looks like this: # Load libraries library(tcltk) library(tidyverse) library(officer) filepath <- setwd(tk_choose.dir()) filename <- "Now they want us to charge our electric cars from litter bins.docx"...
2023 Dec 30
3
Help request: Parsing docx files for key words and appending to a spreadsheet
...rge our electric cars from litter bins.docx" #full_filename <- paste0(filepath, filename) full_filename <- paste(filepath, filename, sep="/") if (!file.exists(full_filename)) { ? message("File missing") } else { ? content <- read_docx(full_filename) |> ??? docx_summary() ? # this reads docx for the full filename and ? # passes it ( |> command) to the next line ? # which summarises it. ? # the result is saved in a data frame object ? # called content which we shall show some ? # heading into from ? head(content) } Results in this error now:Error in x$...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...c("docx") && > grepl("^([fh]ttp)", file) :'length = 9' in coercion to 'logical(1)' help(read_docx) says that the function only imports one docx file. In order to read multiple files, use a for loop or the lapply function. > content <- officer::docx_summary("Now they want us to charge our > electric cars from litter bins.docx") # A title of one of the articles > > The error returned is:Error in x$doc_obj : $ operator is invalid for > atomic vectors A similar problem here. help(docx_summary) says that the function accepts &quo...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
help(read_docx) says that the function only imports one docx file. In > order to read multiple files, use a for loop or the lapply function. > I told you people will suggest better ways to loop!! > > docx_summary(read_docx("Now they want us to charge our electric cars > from litter bins.docx")) should work. > Ivan thanks for spotting my fail! Since the OP is new to all this I'm going to suggest a little tweak to this code which we can then build into a for loop: filepath <- getwd()...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...t;- read_docx(files) Results in this error:Error in filetype %in% c("docx") && grepl("^([fh]ttp)", file) :'length = 9' in coercion to 'logical(1)' No idea how to debug that. Even when trying Calum's suggestion with officer: content <- officer::docx_summary("Now they want us to charge our electric cars from litter bins.docx") # A title of one of the articles The error returned is:Error in x$doc_obj : $ operator is invalid for atomic vectors ################## (2) Second Attempt: # Load libraries library(tcltk) library(tidyverse) librar...
2023 Dec 30
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...> > > help(read_docx) says that the function only imports one docx file. In > > order to read multiple files, use a for loop or the lapply function. > > > > > > I told you people will suggest better ways to loop!! > > > > > > > > docx_summary(read_docx("Now they want us to charge our electric cars > > from litter bins.docx")) should work. > > > > > > Ivan thanks for spotting my fail! Since the OP is new to all this I'm > > going to suggest a little tweak to this code which we can then buil...
2023 Dec 30
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...n 29/12/2023 22:25, CALUM POLWART wrote: > > > help(read_docx) says that the function only imports one docx file. In > order to read multiple files, use a for loop or the lapply function. > > > I told you people will suggest better ways to loop!! > > > > docx_summary(read_docx("Now they want us to charge our electric cars > from litter bins.docx")) should work. > > > Ivan thanks for spotting my fail! Since the OP is new to all this I'm > going to suggest a little tweak to this code which we can then build > into a for loop:...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...eadsheets https://github.com/jqnatividad/qsv is my goto weapon. Can also read and write XLSX and others. A sample document or two would always be helpful... el On 29/12/2023 21:01, CALUM POLWART wrote: > It sounded like he looked at officeR but I would agree > > content <- officer::docx_summary("filename.docx") > > Would get the text content into an object called content. > > That object is a data.frame so you can then manipulate it. > To be more specific, we might need an example of the DF [...] >> On Fri, Dec 29, 2023 at 10:14 AM Andy <phaedrusv at gm...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
It sounded like he looked at officeR but I would agree content <- officer::docx_summary("filename.docx") Would get the text content into an object called content. That object is a data.frame so you can then manipulate it. To be more specific, we might need an example of the DF You can loop this easily with a for statement although there are people who prefer a non-for ap...
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
...v is my > goto weapon. Can also read and write XLSX and others. > > A sample document or two would always be helpful... > > el > > On 29/12/2023 21:01, CALUM POLWART wrote: >> It sounded like he looked at officeR but I would agree >> >> content <- officer::docx_summary("filename.docx") >> >> Would get the text content into an object called content. >> >> That object is a data.frame so you can then manipulate it. >> To be more specific, we might need an example of the DF > [...] >>> On Fri, Dec 29, 2023 at 10:14...
2023 Dec 29
2
Help request: Parsing docx files for key words and appending to a spreadsheet
Hi Andy: I don?t have an answer but I do have what I hope is some friendly advice. Generally the more information you can provide, the more likely you will get help that is useful. In your case you say that you tried several packages and they didn?t do what you wanted. Providing that code, as well as why they didn?t do what you wanted (be specific) would greatly facilitate things. Happy
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
checkout the 'officer' package Thanks Jim Holtman *Data Munger Guru* *What is the problem that you are trying to solve?Tell me what you want to do, not how you want to do it.* On Fri, Dec 29, 2023 at 10:14?AM Andy <phaedrusv at gmail.com> wrote: > Hello > > I am trying to work through a problem, but feel like I've gone down a > rabbit hole. I'd very much