How to use cut with multiple character delimiter in Unix?
Since | is a valid regex expression, it needs to be escaped with \\| or put in square brackets: [|]. You can do this: awk -F’ \\|\\|\\| ‘ ‘{print $1}’ file Some other variations that work as well: awk -F’ [|][|][|] ‘ ‘{print “$1”}’ file awk -F’ [|]{3} ‘ ‘{print “$1”}’ file awk -F’ \\|{3} … Read more