I'm pretty new to AWK, and have question I hope someone can help me with: I have the a pattern that looks something like this:
620
621
622
623
624
624 66.75, 150.13
625
625 67.24, 153.31
626
627
628
628 68.14, 151.98
etc,etc
Using an awk script I'm trying to achieve the following result: I want to remove the duplicates from my first column of numbers (a counter) and concatenate my data (2nd & 3rd column). So I would like my data to look like this:
620
621
622
623
624 66.75, 150.13
625 67.24, 153.31
626
627
628 68.14, 151.98
So far I have been trying stuff like storing the first field in a variable and then test if the following number is equal or not. But I think I would have to do something with going back one step and change the previous printed variable if a duplicate field is found. How can I do this using AWK? Thanks a lot!