I am new to linux and the command line. I am trying to find a command to that will allow me to replace white space (in a .csv text file) with a semi-colon for all fields except the first. Please see example below, any help would be gratefully received, I have spent a long time looking for a solution. If you do have an answer could you please explain the command so I can try and learn how and why. Many thanks.
Example of input text:
0 k__Bacteria p__Firmicutes c__Bacilli
1 k__Bacteria p__Firmicutes c__Clostridia
2 k__Bacteria p__Bacteroidetes c__Bacteroidia
3 k__Bacteria p__Bacteroidetes c__Bacteroidia
What I need the out put to be:
0 k__Bacteria;p__Firmicutes;c__Bacilli
1 k__Bacteria;p__Firmicutes;c__Clostridia
2 k__Bacteria;p__Bacteroidetes;c__Bacteroidia
3 k__Bacteria;p__Bacteroidetes;c__Bacteroidia
1 Answer