Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
You could translate all spaces and double quotes to |, then squeeze (and |ss and finallyqueeze) then cut from the 2nd character to the end of line:
tr
|
|s
cut
tr -s '[[:blank:]"]' \| <infile | tr -s \| | cut -c2-
You could translate all spaces and double quotes to |, then squeeze |s and finally cut from the 2nd character to the end of line:
tr '[[:blank:]"]' \| <infile | tr -s \| | cut -c2-
You could translate all spaces and double quotes to | (and squeeze) then cut from the 2nd character to the end of line:
s
tr -s '[[:blank:]"]' \| <infile | cut -c2-