-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
  • 330,190
  • 66
  • 504
  • 555
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
  • 257,635
  • 38
  • 339
  • 400