#!/bin/bash # try one #sed 's/ *||| */\t/' raw.txt > processed.tsv # try two - there were a few entries with multiple ||| delimiters, so we skip them grep -Ev '(\|\|\|).*?\|\|\|' raw.txt | sed 's/ *||| */\t/' > processed.tsv