TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got None Type) - docx

When I try to generate an interview with docx file in Docassemble it raises the error:
TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got None Type)

The problem is in docx file. Create a new docx file in Windows, insert just one field in it to test. If it works, then you add the other fields.

There's actually an open pull request to fix this bug in docxcompose, an upstream dependency of Docassemble. For a specific DOCX file, you should be able to fix it by opening the file in Word and then saving, as it appears to be an issue with very small errors that Word automatically fixes on save.
https://github.com/4teamwork/docxcompose/pull/58

Related

R Markdown Error reading bibliography: pandoc document conversion failed with error 25

pandoc seems to have a problem with reading my bib file giving me this error:
Error reading bibliography file library.bib:
(line 19001, column 1):
unexpected "#"
expecting space, ",", white space or "}"
Error: pandoc document conversion failed with error 25
Execution halted
I am using Mendeley to produce my library.bib and the file includes all of my references (almost 30 thousand lines).
When I search the line in question, everything seems to be in order (no unusual characters). Deleting the reference doesn't help. The "#" from the error is at the beginning of every reference in the file.
Using a smaller subset of my reference list from another folder doesn't help, I only managed to knit my document with a very small subset (1000 lines).
The library.bib is a copy in my project folder so it is not influenced by running Mendeley.
I can make a subfolder with references needed for this only document but it doesn't provide a long-term solution - I would like to use the whole library and not make a subfolder for each document I am working on.
Is there something simple I am missing?
Thanks!

How to code data files from excel into Rstudio

I am trying to import data from excel into R (stats class), but we are not allowed to use the import function. We have to code it in. I got help last week from a graduate student, but I think because I got a new laptop over the weekend, the Rmd file cannot be used as my reference markdown anymore. Here is what I've tried inputting:
library(tidyverse)
data.frame(readxl::read_excel(path = "./data/thedataweprovide.xlsx", sheet = "Problem 1"))
Error: `path` does not exist: ‘./data/thedataweprovide.xlsx’
> setwd("C:/Users/Jasmine Ferrell/Documents/BME_Statistical_Methods/Project_1")
Error in setwd("C:/Users/Jasmine Ferrell/Documents/BME_Statistical_Methods/Project_1") :
cannot change working directory
> pone
Error: object 'pone' not found
> setwd("C:/Users/Jasmine Ferrell/Documents/BME_Statistical_Methods/Project_1")
Error in setwd("C:/Users/Jasmine Ferrell/Documents/BME_Statistical_Methods/Project_1") :
cannot change working directory
> setwd("C:\Users\ferre\OneDrive\Documents\BME_Statistical_Methods\Project_1")
Error: '\U' used without hex digits in character string starting ""C:\U"
> setwd(C:/Users/ferre/OneDrive\Documents/BME_Statistical_Methods/Project_1)
Error: unexpected '/' in "setwd(C:/"
It looks like your paths are the problem. You could first try to get the working directory you are currently in with the function getwd() this may help you to figure out how you could correct your paths. Do not use single Backslashes (\) in paths, only use foreward-slashes (/).
As saae mentioned its a problem with path. Try these and should be able to get it working.
Type in your Rstudio
getwd()
This gives the current path which is currently set. If you are files are somewhere else, then you won't find it.
To change the path
go to your file location and copy the path. For example in windows, you go to the folder and click on properties, there you will see location. Copy the location and add it to the below code.
setwd("//abcdefg/somerandomguy/Profile/Desktop/My files/R_project")
Then you can run your code to read the files.

Informatica Cloud- Null character issue in from dat file

I am getting the following task error in Informatica Cloud.
FR_3085 ERROR: Row [1]: 2-th character is a null character, which is not allowed in a text input file d:\temp\psaas.csv.
How to fix this issue, I tried to use ReplaceStr(0, input, char(10), '') in the filter condition, but its still throwing me an error?
thanks
Bhavesh
What character set do you have set for the connector? You may need to set it to windows character or make sure your file is using UTF-8. Attaching the source file may help to understand the issue.
Your input file contains some invalid characters.
You can fix this issue by changing the file encoding.
Try to change the file encoding to "UTF-8" or "ANSI". Save the file and restart the job.

Unexpected input error in Shiny, but unable to locate the source of error

I am getting the unexpected input error in UI.R, as follows:
ERROR: C:\Users\myApp/ui.R:1:2: unexpected input
1: ï»
However, when I try to locate the error at line 1, there is absolutely nothing of the form ï».
To resolve this error, I tried saving my UI.R file as a text file and changing the encoding to UTF-8, but this still does not remove the strange character. I also tried removing the first couple of lines and re-writing the code, but it still gives the same error!
How can I remove this character? Should I use another text editor?
I am using base R, not R Studio. And I had copy-pasted my code form my GitHub account, if that info is required...
Code from my file can be viewed here.
Many thanks.
I have this same issue in the year '19, and took me a while to run into this question from the year '14.
Not Shiny, but a regular R project with its .Rprofile.
The solution that worked for me is:
Open your file in Notepad++. From the Encoding menu, select Convert to UTF-8 (without BOM), save the file, replace the old file with this new file. And all is fixed.

read.bib gives lex fatal error - end of buffer missed, {bibtex} package

I am attempting to create a script which will distribute a number of pdfs into a folder tree according to tags. I have the file metadata (including filepath) in a bibtex format. I have tried a number of work-arounds to import the metadata, but so far have been unable to get the filepath, year, title, and tags into a single data frame.
When I try to import using read.bib (which seems the simplest solution) I get the following error:
dbase_full <- read.bib("C:/Users/WILIAM-PLAN/Desktop/My Collection 23 07.bib")
Error in read.bib("C:/Users/WILIAM-PLAN/Desktop/My Collection 23 07.bib") :
lex fatal error:
fatal flex scanner internal error--end of buffer missed
I have looked up the error but language of the 'under the hood' part of the {bibtex} package (lex scanners etc) is beyond me.
Is there quick fix for this error?
If not, is there another way to get the file metadata from bibtex into a dataframe?
i had the same problem.
The problem is that in the bib file could be in some fields (as abstract) lines with a lot of chars..
You need to split and wrap them.
I hope it is useful

Resources