How to join Bibtex files in R

Asked

Viewed 661 times

2

How can I join multiple extension files .bib in a single file on the R?

I’m learning to use the Bibliometrix package, and I need to put together 99 files .bib to a single file.

Thank you, guys.

  • You probably only need to adapt this code. http://answall.com/a/48821/6036 The file . Bib is a txt type same

  • Daniel, thank you for the comment initially. I did what you suggested and came up with the following message: Error in read.table(file = file, header = header, Sep = Sep, quote = quote, : more Columns than column Names 5 stop("more Columns than column Names") 4 read.table(file = file, header = header, Sep = Sep, quote = quote, Dec = Dec, Fill = Fill, comment.char = comment.char, ...) 3 read.delim(x, header = TRUE, Sep = ",", Dec = "." ) 2 FUN(X[[i]], ...) 1 lapply(em, Function(x) read.delim(x, header = TRUE, Sep = ",", Dec = "." )) You know what can be?

  • I am new in programming and new in the use of this site. Forgive me for the somewhat messy response

1 answer

1


The solution to your problem is even simpler than the code that Daniel Falbel suggested. You don’t even need the package bibliometrix because it even reads the files as text. What you need is to just read the files, join in one object and write again. For example:

files <- list.files(path = "C:/Users/Eu/MeusBibs", pattern = "\\.bib")
bibdata <- lapply(files, readLines)
write(unlist(bibdata), file = "big.bib")

Your new file will be in the R working directory.

  • Molx, thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.