5

awk performance issue

view full story
linux-howto

http://www.unix.com – Hi, I have the code below as Code: cat <filename> | tr '~' '\n' | sed '/^$/ d' | sed "s/*/|/g" > <filename> awk -F\| -vt=`date +%m%d%y%H%M%S%s` '$1=="ST",$1=="SE"{if($1=="ST"){close(f);f="214_edifile_"t"" ++i} ; $1=$1; print>f}' OFS=\| <filename> This script replaces some characters and extracts the records starting from ST to SE and writes that in a seperate file. It works fine for smaller file, but when trying input file of bigger size the script is giving only partial output. Can you tell me what (HowTos)