Skip to main content
2 of 2
formatting
glenn jackman
  • 88.5k
  • 16
  • 124
  • 179

how to replace a strings in a file with delimited without effecting numericals?

Input file:

123 exx abcdef 890 hello-hi-welcome and name in-India 1 3.45 1.3538 8.773
456 hfjgt 928 aetr-new-abc-India 1 9.7392 18.1903 8.752

Output:

123,exx abcdef,890,hello-hi-welcome and name in-India,1,3.45,1.3538,8.773
456,hfjgt,928,aetr-new-abc-India,1,9.7392,18.1903,8.752

How can we write a shell script for this?