Shell script not parsing complete file using AWK

view full story

http://www.unix.com – Hi, I have shell script which will read single edi document and break data between ST & SE to separate files.Below example should create 3 separate files. I have written script with the below command and it is working fine for smaller files. Code: awk -F\| -vt=`date +%m%d%y%H%M%S%s` \   '$1=="ST",$1=="SE"{if($1=="ST"){close(f);f="edi850."t"" ++i} ; $1=$1; print>f}' OFS=\| inputfile If i run it using large file around 10 MB, then it is not working. It is writing partial file. Please help me with the correct code. e (HowTos)