I have a file with multiple columns and rows, and I need to cut the last 5 strings of my third column and print it in an extra column. For example:
1 info1 AAAAAAAAAAA
2 info23 TTTTTTTTTT
3 ingo45 ATATATATATATAT
4 info67 GGGYYYYUUUUUUU
My output will be:
1 info1 AAAAAAAAAAA AAAAA
2 info23 TTTTTTTTTT TTTTT
3 ingo45 ATATATATATATAT TATAT
4 info67 GGGYYYYUUUUUUU UUUUU
I was able to cut just the third column only by:
cat input_file | cut -f3 | grep -o '.\{5\}$' > output_file
But I want to maintain my original table. Any suggestion?