chalcopyrites
Technical User
Hello,
I hope you can help me!
I have a file like this:
545235.45 546547.36 7551.33 78854 0
465745.54 857435.35 7445.36 78854 0
774546.32 548745.35 4552.25 78854 0
465433.32 457657.25 7865.36 78854 0
754654.32 454654.25 7845.37 78854 0
755445.32 454544.85 7854.35 78854 1
744556.34 755442.36 7854.37 78854 1
787545.32 785566.32 7854.64 78854 1
785845.38 784545.14 7855.39 78854 1
I would like to change the last column of my file so it looks like this:
545235.45 546547.36 7551.33 78854 1
465745.54 857435.35 7445.36 78854 2
774546.32 548745.35 4552.25 78854 2
465433.32 457657.25 7865.36 78854 2
754654.32 454654.25 7845.37 78854 3
755445.32 454544.85 7854.35 78854 1
744556.34 755442.36 7854.37 78854 2
787545.32 785566.32 7854.64 78854 2
785845.38 784545.14 7855.39 78854 3
ie instead of a constant number in the last column for each group of records there is a 1 for the first line of the group, 3 for the last and 2 for the lines in between. The value in the end column increments by 1 until it reaches 999 when it starts at 0 again and there isn't a fixed number of records for each group.
Many thanks!
I hope you can help me!
I have a file like this:
545235.45 546547.36 7551.33 78854 0
465745.54 857435.35 7445.36 78854 0
774546.32 548745.35 4552.25 78854 0
465433.32 457657.25 7865.36 78854 0
754654.32 454654.25 7845.37 78854 0
755445.32 454544.85 7854.35 78854 1
744556.34 755442.36 7854.37 78854 1
787545.32 785566.32 7854.64 78854 1
785845.38 784545.14 7855.39 78854 1
I would like to change the last column of my file so it looks like this:
545235.45 546547.36 7551.33 78854 1
465745.54 857435.35 7445.36 78854 2
774546.32 548745.35 4552.25 78854 2
465433.32 457657.25 7865.36 78854 2
754654.32 454654.25 7845.37 78854 3
755445.32 454544.85 7854.35 78854 1
744556.34 755442.36 7854.37 78854 2
787545.32 785566.32 7854.64 78854 2
785845.38 784545.14 7855.39 78854 3
ie instead of a constant number in the last column for each group of records there is a 1 for the first line of the group, 3 for the last and 2 for the lines in between. The value in the end column increments by 1 until it reaches 999 when it starts at 0 again and there isn't a fixed number of records for each group.
Many thanks!