summaryrefslogtreecommitdiff
path: root/bib2tsv
blob: 75f3ce763fd946f152bc1aa9d98dee4233731398 (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;
}
'