java 从文件中查找一字符串,然后,读出其上一行中的某几个字符
各位高手,我有一个文本文件,格式基本上是这样的:
[Term]
id: MI:0491
name: in silico
def: "Results generated by predictive bioinformatics approaches rather than experimental data.\nOBSOLETE as a full host organisms description is recommended using tax id == -1 as convention to refer to 'in vitro' interaction." [PMID:14755292]
related_synonym: "Predictive" []
is_obsolete: true
[Term]
id: MI:0489
name: source database
def: "Database that orignally provided the interaction record for exchange purposes." [PMID:14755292]
is_a: MI:0444 ! database citation
希望从这个文本文件中查找name: ******变量,如name: in silico,读取出其上一行的MI:0491,怎么才能做到啊?谢谢了