Adding the squence numbers

Hi All,

Could you please help me on this requirement.

File data:

A
A
A
B
B
B

i need the output like

A1
A2
A3
B1
B2
B3

Thanks,
Mk

Welcome to the forum.

Any attempts / ideas / thoughts from your side? Any preferred tools? And - please indicate if this is homework / classwork or not.

Hello bmk123,

Welcome to UNIX and Linux forums. Could you please try following and let me know if this helps you.

awk '{print $0,++a[$0]}' OFS=""  Input_file

Thanks,
R. Singh

2 Likes

Thanks alot Singh