I have a file with different columns (three in this simplified example). The rows contain data of different replicates (Replicate_A, Replicate_B, Replicate_C). However, there is not the same amount of rows per replicate (It can be 3, 4, 5 rows for example). The only thing I know is that each replicate starts with the number 1. I would like to add an extra column with the Replicate name. Any suggestion of how to add that column? I could create an extra file with the list of names to add in this extra column. Any suggestion is helpful.
The file I have is a tab delimited file.
1 x x 2 x x 3 x x 4 x x 1 x x 2 x x 3 x x 1 x x 2 x x 3 x x
The file I want to have
1 x x Replicate_A 2 x x Replicate_A 3 x x Replicate_A 4 x x Replicate_A 1 x x Replicate_B 2 x x Replicate_B 3 x x Replicate_B 1 x x Replicate_C 2 x x Replicate_C 3 x x Replicate_C