When I use cat file_name.txt
I get the logs in one line. How to separate each string to new line?
"Rest API SRV01""Rest API SRV02""Rest API SRV01"
Expected output:
"Rest API SRV01"
"Rest API SRV02"
"Rest API SRV01"
When I use cat file_name.txt
I get the logs in one line. How to separate each string to new line?
"Rest API SRV01""Rest API SRV02""Rest API SRV01"
Expected output:
"Rest API SRV01"
"Rest API SRV02"
"Rest API SRV01"
One way is to replace each ""
with "\n
:
sed 's/\"\"/\"\n\"/g' <<< '"Rest API SRV01""Rest API SRV02""Rest API SRV01"'
"Rest API SRV01"
"Rest API SRV02"
"Rest API SRV01"