awk - Using pipe character as a field separator -


i'm trying different commands process csv file separator pipe | character.

while commands work when comma separator, throws error when replace pipe:

awk -f[|] "nr==fnr{a[$2]=$0;next}$2 in a{ print a[$2] [|] $4 [|] $5 }" ofs=[|] file1.csv file2.csv  awk "{print nr "|" $0}" file1.csv 

i tried, "|", [|], /| no avail.

i'm using gawk on windows. i'm missing?

try escape |

echo "more|data"  | awk -f\| '{print $1}' more 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -