]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Script for converting the ISO 639-2 web site to a text file.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Oct 2006 11:41:24 +0000 (11:41 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:09 +0000 (12:14 +0200)
gettext-tools/doc/Admin/iso-639-2-table.sh [new file with mode: 0755]

diff --git a/gettext-tools/doc/Admin/iso-639-2-table.sh b/gettext-tools/doc/Admin/iso-639-2-table.sh
new file mode 100755 (executable)
index 0000000..4a8011a
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Extracts the ISO_639-2 file from http://www.loc.gov/standards/iso639-2/code_list.html
+# Usage: iso-639-2-table.sh < code_list.html
+LC_ALL=C
+export LC_ALL
+tr '\012' ' ' |
+sed -e 's,<tr ,\
+<tr ,g' |
+sed -n -e 's,^<tr [^>]*>[^<>]*<td[^>]*>\([^<>]*\)</td>[^<>]*<td>&nbsp;</td>[^<>]*<td>\([^<>]*\)</td>.*$,\1   \2,p' |
+iconv -f ISO-8859-1 -t UTF-8