Skip to main content
Post Closed as "Needs details or clarity" by Satō Katsura, Stephen Rauch, Jeff Schaller, GAD3R, G-Man Says 'Reinstate Monica'
formatting
Source Link
glenn jackman
  • 88.5k
  • 16
  • 124
  • 179

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

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

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?

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?

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?

Source Link

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?