Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems parsing .bib from ORCID #21

Open
gorkang opened this issue Feb 14, 2018 · 4 comments
Open

Problems parsing .bib from ORCID #21

gorkang opened this issue Feb 14, 2018 · 4 comments

Comments

@gorkang
Copy link

gorkang commented Feb 14, 2018

When reading a .bib file exported from an ORCID profile (Export works), bib2df() have some problems parsing it.

The same file can be imported in zotero without problems.

See attached bib file: works_G.zip

@gorkang
Copy link
Author

gorkang commented Feb 17, 2018

OK, still some issues, but I think I found a relatively simple solution:

This has the weird parting issues (new columns are created for some of the works)

  bib2df("DEV/Bibtex/works_G.bib") 

screenshot from 2018-02-17 14-24-29

With this we correct the main issue

  temp = read_file("works_G.bib") %>% 
    gsub("@(.+?),", "\n@\\1,\n", .) %>%
    gsub("},", "},\n", .) 
  
  write_file(temp, "works_G_corrected.bib")
  
  bib2df("DEV/Bibtex/works_G_corrected.bib") 

screenshot from 2018-02-17 14-35-14

Maybe it could be nice to integrate a cleaning up function to get rid of the most common issues?

@HedvigS
Copy link
Contributor

HedvigS commented Jun 20, 2019

I also had this problem with a file, am now going to do the gsub fix as well. If there are any news on any changes in the package I hope they'll be posted in this thread. Thanks @xrotwang for noticing this thread.

@ottlngr
Copy link
Contributor

ottlngr commented Jun 20, 2019

Hi, thanks for your messages, @gorkang and @HedvigS .

Indeed bib2df currently has problems parsing a file if the key-value pairs are not separated by linebreaks. I'm currently working on another package but soon will be working on bib2df again. Then I will change the whole mechanism to be indenpendent on linebreaks.

By then the way described by @gorkang is a good way to go.

@HedvigS
Copy link
Contributor

HedvigS commented Jun 20, 2019

Yep, I'm doing the gsub thing in the meantime and it's work.

Thanks again for a great package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants