Tab after every two columns

Hello,

I have a huge file which contain space separated columns. I want to add a tab after every two columns in the file.

for example

input
A B C D E F G H
A B C D E F G H

output

A B     C D    E F    GH
A B     C D    E F    GH

Please help.

Thanks
R

Hi

awk '{for(i=2;i<=NF;i+=2)$i=$i"\t"}1' file

Guru.

1 Like