I have a file foo
that has the following data:
A<|>B<|>C<|>D
1<|>2<|>3<|>4
I want to prope
The pipe is a special character in a regex, so you need to escape it with a backslash. But this backslash is also a special character for the string literal, so it needs to be escaped again. So you end up with the following:
awk -F '<\\|>' '{$1=$1}1'
awk 'BEGIN {FS="<\\|>"} {$1=$1}1'
The reason for this syntax is explained quite well here: http://www.gnu.org/software/gawk/manual/gawk.html#Computed-Regexps. In short, the expression is parsed twice.