Skip to main content
1 of 2
don_crissti
  • 85.6k
  • 31
  • 234
  • 262

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-
don_crissti
  • 85.6k
  • 31
  • 234
  • 262