converting ksh scripts--.bat in window's

hi evry one , I did some ksh scripts for file editing in AIX 5.2 ver,
issue is while I was trying to run these scripts in windows box as batch files windows is not recognising the awk part of the ksh script,as it is GNU environment, so any one who can help me will be appreciated.
this is the sample ksh script and followed by .bat file , plzz let me know whether my syntax is correct or not in the .bat file

#!/bin/ksh
egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End |Date:|Plan Beginning
|Page |Fund |Total|Page|^$" $PMSRC/usi38.txt|awk 'BEGIN{ OFS=":"}
{
if( match ( $0 , "Fund:" ) )
{
split($0,arr,":")
cmpny = arr[2]
getline ;
if( ! match($0 , "Code Balance" ) )
{
cmpny = cmpny $0;
getline
}
}
else
print cmpny , $0

}'>$PMSRC/usi38final.txt
___________________________________
.bat file
___________________________________
REM #!/bin/ksh
egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End |Date:|Plan Beginning|Page |Fund |Total|Page|^$" D:\temp\usi38.txt| awk "BEGIN { OFS=":"} { if( match( $0,"Fund:")){ split( $0,arr,":")cmpny = arr[2] getline; if( ! match( $0 ,"Code Balance")) { cmpny = cmpny $0; getline}} else print cmpny,$0}" > D:\temp\usi38final.txt

I doubt that you have the egrep working either. You can't just shove a ksh script into a bat file and run it on windows. And what do you mean by "windows" anyway? There are more options available on XP pro then there are on XP Home. And Windows 95 would be a real problem. Assuming XP Pro, I see two paths available here:

  1. Install a Unix style environment on your "windows" box. Look in our FAQ section for a discussion of all of the options we know about. I use Microsoft SFU on XP Pro and it works pretty well...but it only runs on XP Pro.

  2. A complete rewrite in some language more commonly used on Windows. Using a bat file is possible but it is a stretch. I would probably go for VBscript running under WSH.

but egrep is working fine , yes it is win pro edition.problem is with awk part , I commented awk part and ran only the egrep its working fine when i am trying to run both its not working , when i changed awk to gawk its recognizing but giving me a syntax error at OFS":" , should there be any other syntax while using characters like ':' .

If you have egrep and gawk then maybe you have bash too. bash should be able to run the original script.