R: Import bibtex files

readBib {rbibutils} | R Documentation

## Import bibtex files

### Description

Import bibtex files.

### Usage

    readBib(file, encoding)

    writeBib(object, con = stdout(), append = FALSE)

### Arguments

`file` | name or path to the file, a character string.
`encoding` | the encoding of `file`, a character string.
`object` |
`con` | filename (a character string) or a text connection
`append` | if `TRUE` append to the file.

### Details

Read a bibtex file and convert the result to `bibentry` or write a `bibentry` to a bibtex file.

### Value

for `readBib`, a `bibentry` object

for `writeBib`, the `bibentry` object (invisibly)

### Author(s)

Georgi N. Boshnakov

### See Also

`bibConvert`

### Examples

    ## create a bibentry object
    bibs <- readBib(system.file("REFERENCES.bib", package = "rbibutils"),
                    encoding = "UTF-8")
    ## write bibs to a file
    fn <- tempfile(fileext = ".bib")
    writeBib(bibs, fn)

    ## see the contents of the file
    readLines(fn) # or: file.show(fn)

    unlink(fn)

[Package rbibutils version 1.4 Index]