I have a file like:
file.dat
1 2
1 3
2 1
2 4
2 3
3 4
The left column is sorted. I would like to write a new file liek this:
1 2 3
2 1 4 3
3 4
In the first column should be the left column number of file.dat and next to it the right column numbers. Any help?
Output:
This script will run with
awk. Name iffile.awk:Run like this: