diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /indexing/texindex/ix.rotate |
Initial commit
Diffstat (limited to 'indexing/texindex/ix.rotate')
-rw-r--r-- | indexing/texindex/ix.rotate | 19 |
1 files changed, 19 insertions, 0 deletions
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 + } + } |