Count number of characters in particular column

Hi i have data like
abchd 124 ldskc aattggcc

each separated by tab space i want to count number of characters in 4th column and print it in new column with tabspace for every line can anyone help me how to do it.

Thanks.

awk '{print $0"\t"length($4)}' infile

Please use code tags when posting sample input/output or code.

1 Like
awk '$0=$0"\t"length($4)' input.txt
1 Like

Thank you it worked.