summaryrefslogtreecommitdiff
path: root/bib2tsv
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2020-01-05 15:38:56 +0000
committerKatolaZ <katolaz@freaknet.org>2020-01-05 15:38:56 +0000
commite0d092afafaed0abb80e7dd448379abf7562cd8d (patch)
treeb937503c0b4f788e4578733c7e367c8c71f322b6 /bib2tsv
parent818d316adec9390a35231b44c827a493352a2cdc (diff)
add bib2tsv
Diffstat (limited to 'bib2tsv')
-rwxr-xr-xbib2tsv26
1 files changed, 26 insertions, 0 deletions
diff --git a/bib2tsv b/bib2tsv
new file mode 100755
index 0000000..0dafc7a
--- /dev/null
+++ b/bib2tsv
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+
+#
+# convert a bibtex entry into a single record (tsv)
+#
+
+cat | awk '
+
+/^%/{
+ next
+}
+
+/^@.*\{/{
+ cur =$0
+}
+
+
+/^\}[ ]*$/{
+ print cur"\t"$0
+}
+
+/^[ ]*.*=.*/{
+ cur=cur"\t"$0;
+}
+'