Multiple columns to a single column

I have this input:

10 22 1  100
11 22 10 1  50
14 3 1  100
23 3 1  100
24 15 1  100
10 22 5 3 1  33.333
11 22 1  100

It has an inconsistent number of fields but the last field is determined by 100/(NF-2) using awk.

I want to take this multiple columned input file and transform so that ANY field between $3 and the second to last field $(NF-1) is in one column with the second column being the last column from the input file.

So, the output would look like above:

1  100
10  50
1  50
1  100
1  100
1  100
5  33.333
3  33.333
1  33.333
1  100

I found this awk script that uses arrays to put multiple columns into 1 but it also adds NR, too.

awk '{for(i=1;i<=NF;i++)if(arr ~ /./)arr=arr"\n"$i;else arr=$i}END{for(x=1;x<=length(arr);x++)printf("%s\n",arr[x])}'

I messed around with this for awhile but couldn't get it to work. :wall:

please help.

thanks!

awk '{for(i=3;i<NF;i++){print $i FS $NF}}' yourfile
awk '{for(i=3;i<NF;i++){print $i,$NF}}' yourfile

thank you!