summaryrefslogtreecommitdiff
path: root/bib2tsv
blob: f46084307da59dfe7eb48c5b060d49a40928c9d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh


#
# convert a bibtex entry into a single record (tsv)
#

cat | awk '

/^%/{
	next
}

/^@.*\{/{
	gsub("^[[:blank:]]+", "")
	cur=$0
}


/^\}[ 	]*$/{
	gsub("/^[[:blank:]]+/", "")
	print cur"\t"$0"\n"
}

/^[	 ]*.*=.*/{
	gsub("^[[:blank:]]+", "")
	cur=cur"\t"$0;
}
'