如何使用Java读取(.bib)文件格式的内容 [英] How to read the contents of (.bib) file format using Java
问题描述
我需要读取.bib文件并将其标签插入到bib条目对象中
I need to read .bib file and insert it tags into an objects of bib-entries
文件很大(几乎4000行),所以我的第一个问题使用什么(bufferrReader或FileReader)
的通用格式为
the file is big (almost 4000 lines) , so my first question is what to use (bufferrReader or FileReader) the general format is
@ARTICLE{orleans01DJ,
author = {Doug Orleans and Karl Lieberherr},
title = {{{DJ}: {Dynamic} Adaptive Programming in {Java}}},
journal = {Metalevel Architectures and Separation of Crosscutting Concerns 3rd
Int'l Conf. (Reflection 2001), {LNCS} 2192},
year = {2001},
pages = {73--80},
month = sep,
editor = {A. Yonezawa and S. Matsuoka},
owner = {Administrator},
publisher = {Springer-Verlag},
timestamp = {2009.03.09}
}
@ARTICLE{Ossher:1995:SOCR,
author = {Harold Ossher and Matthew Kaplan and William Harrison and Alexander
Katz},
title = {{Subject-Oriented Composition Rules}},
journal = {ACM SIG{\-}PLAN Notices},
year = {1995},
volume = {30},
pages = {235--250},
number = {10},
month = oct,
acknowledgement = {Nelson H. F. Beebe, University of Utah, Department of Mathematics,
110 LCB, 155 S 1400 E RM 233, Salt Lake City, UT 84112-0090, USA,
Tel: +1 801 581 5254, FAX: +1 801 581 4148, e-mail: \path|beebe@math.utah.edu|,
\path|beebe@acm.org|, \path|beebe@computer.org| (Internet), URL:
\path|http://www.math.utah.edu/~beebe/|},
bibdate = {Fri Apr 30 12:33:10 MDT 1999},
coden = {SINODQ},
issn = {0362-1340},
keywords = {ACM; object-oriented programming systems; OOPSLA; programming languages;
SIGPLAN},
owner = {Administrator},
timestamp = {2009.02.26}
}
如您所见,有些条目具有多于一行的内容,以}
结尾的条目以}或}}结尾,
As you can see , there are some entries that have more than line, entries that end with } entries that end with }, or }},
另外,某些条目在中间
中有{..},{..} ..所以,我对如何开始读取此文件有些困惑,并且如何获取这些条目并进行操作。
任何帮助将不胜感激。
Also , some entries have {..},{..}.. in the middle so , i am a little bit confused on how to start reading this file and how to get these entries and manipulate them. Any help will be highly appreciated.
推荐答案
我们目前在 JabRef 。
这些是当前选项:
- JBibTeX
- ANTLRv3 Grammar
- JabRef's BibtexParser.java
这篇关于如何使用Java读取(.bib)文件格式的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!