I need to do something very similar to this Replace string with sequential index, but I don't need to add a number to a column, but substitute a whole column with incrementing numbers. Like this:
0 0 chr1 3000575 3000801 0 chr1 4340023 4340249 32 32
0 0 chr1 3000641 3000801 -1 chr1 3311943 3311783 32 32
0 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
0 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
0 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
becomes
0 0 chr1 3000575 3000801 0 chr1 4340023 4340249 32 32
1 0 chr1 3000641 3000801 -1 chr1 3311943 3311783 32 32
2 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
3 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
4 0 chr1 3000674 3000801 -1 chr1 3001534 3001407 32 32
(I don't care whether it starts with 0 or 1)
I feel very stupid, but I can't adjust the solution from that question to my case...