summaryrefslogtreecommitdiff
path: root/indexing/texindex/ix.rotate
blob: ab3b785291beec1233466be4402c7a4039a1585b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
		}
	}