Abordagem curta awk :
awk '{ $3=$3"_"a[$3]++ }1' file
A saída aproximada:
val1 val2 text_0_0
val1 val2 text_0_1
val1 val2 text_0_2
...
val1 val2 text_1_0
val1 val2 text_1_1
val1 val2 text_1_2
...
val1 val2 text_2_0
val1 val2 text_2_1
val1 val2 text_2_2
-
a[$3]++
- conta a ocorrência do 3º valor de campo via pós-incremento (<var>++
)