Entering edit mode
2.7 years ago
Priya
▴
20
i have a file with two columns as column1 having a string of multiple characters and column2 having a unique id or value but column can have repeating strings. what i want to do is to give a specific number to repeating strings from 1 to n. like if i have a file like this :
GCF_000009885.1_ASM988v1_protein.faa:WP_000014594.1
GCF_000009885.1_ASM988v1_protein.faa:WP_000025662.1
GCF_920103885.1_DJ_protein.faa:WP_230633553.1
GCF_920103885.1_DJ_protein.faa:WP_230633554.1
GCF_920103885.1_DJ_protein.faa:WP_230633555.1
and so on...
(it's a csv file with columns seperated by : ) what i want to do is :
0001:GCF_000009885.1_ASM988v1_protein.faa:WP_000014594.1
0001:GCF_000009885.1_ASM988v1_protein.faa:WP_000025662.1
0002:GCF_920103885.1_DJ_protein.faa:WP_230633553.1
0002:GCF_920103885.1_DJ_protein.faa:WP_230633554.1
0002:GCF_920103885.1_DJ_protein.faa:WP_230633555.1
and so on...
i'm working in linux, any command that can do this would be helpful !
thanks it worked!!