to insert line breaks in a file whenever a comma is encountered-Shell script
I need to write a shell script to re-format a file by inserting line breaks.
The condition is that, a line break should be inserted when we encounter a
"Comma" in the file.
For example, if the file "delimiter.txt" contains:
this, is a file, that should, be added, with a, line break, when we find,
a comma.
The output should be:
this
is a file
that should
be added
with a
line break
when we find a
a comma.
Can i do this using normal grep? or awk? Please guide me.Thanks :)
No comments:
Post a Comment