From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- indexing/texindex/ix.rotate | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 indexing/texindex/ix.rotate (limited to 'indexing/texindex/ix.rotate') diff --git a/indexing/texindex/ix.rotate b/indexing/texindex/ix.rotate new file mode 100644 index 0000000000..ab3b785291 --- /dev/null +++ b/indexing/texindex/ix.rotate @@ -0,0 +1,19 @@ +# ix.rotate: awk - script zur Rotation von Index - Begriffen +# Eingabe: +# string1 string2 string3 ... \t num num ... +# Ausgabe: +# string1 string2 string3 ... \t num num ... +# string2 string3 ... , string1 \t num num ... +# string3 ..., string1 string2 \t num num ... +# +BEGIN { + FS = OFS = "\t" + } + { + print $1, $2 # Drucke die unrotierte Form + for (i=1; (j=index(substr($1, i+1)," "))> 0;) + { + i += j # Finde jeden Blank und rotiere um ihn + printf "%s, %s\t%s\n",substr($1,i+1),substr($1,1,i-1),$2 + } + } -- cgit v1.2.3