-1

I am attempting to write a script to pull all words separated by commas on a new line from a text file that contains the following:

HELLO,DOCTOR,NAME,CONTINUE,YESTERDAY,TOMORROW
John Kugelman
  • 307,513
  • 65
  • 473
  • 519
Obed A.
  • 1
  • 1

1 Answers1

-1

Demonstrating how to apply the individual linked-duplicate questions, each of which addresses a separate element of this question:

IFS=, read -r -a words <file  # from duplicate "How do I split a string on a delimiter?"
printf '%s\n' "${words[@]}"   # from duplicate "Print array elements on separate lines"

Similarly, the approach given in How do I replace : characters with newline? works just as well with , as with : --

tr ',' '\n' <file
Charles Duffy
  • 235,655
  • 34
  • 305
  • 356