Hello Hermann
Thanks alot for your quick answer.
You have written a two dimenmtional array using double braket pairs "a[i][j]".
I thought that in AWK it is not possible to write this syntax.
Until now I have used only one braket pair with a separation character "a[i,j]".
> With Gawk >= 4, you could do something like this:
>
> gawk 'BEGIN {PROCINFO["sorted_in"]="@ind_num_asc"}
>
> {a[$3][$4]=$1 FS $3 FS $4}
>
> END{for (i in a) for (j in a[i]) print a[i][j]}'
My question is here in the END part:
The first for loop goes through both dimensions and the second one only through the first dimensions?
> However, you would loose records, in case of identical X- and Y-values.
I have noticed that in my case the output file has one line less than the input file because of equality of x and y on two lines.
>
> Perhaps a bit OT: Have you considered using the sort utility?
>
What do you mean? I use the asort utility or
should I write the sort program from the scratch instead of using a buit-in function?
Best regards
Mohsen