From Perl to a wndows based script?

Hey guys, I have two scripts that are written in perl and I wan't to know if there is a way to get them put into a dos batch file instead of having to run on a linux box. Here is the first one, I noticed that it uses awk which I believe there might be a windos version of that out these days. My main concern is that the second part that gets called "it.revs" won't be able to be put into a batch file because of the syntax it uses. Thanks for any input or options. Also is it possible to just run a perl script on a windows box with a perl compiler or interperter or something like that?

[code]#!/bin/sh
cd /home/revs
smbmount //bnhcfs/revs /mnt/revs -o username=****
rm /mnt/revs/LIST*
awk -f it.revs /mnt/revs/REV_CHK.txt
smbumount /mnt/revs
[/code]

now here is the it.revs file that awk calls

[code]
{
if ( $1 ~ /^[0-9]/ ) {
FIRST = substr($1,1,3)
SECOND = substr($1,5,2)
THIRD = substr($1,8,4)
MEMBER = FIRST SECOND THIRD
MONTH = substr($2,1,2)
DAY = substr($2,4,2)
YEAR = 20 substr($2,7,2)
DATE = YEAR MONTH DAY
printf("%381s%9s%32s%8s%41s
","ISA*03*USERID *01*PASSW0RD *ZZ*1309927 *ZZ*PC-WEB *030521*1614*U*00401*000000905*1*P*:~GS*HS*USERID*MASS XIX DMA*20030521*1614*1*X*004010X092A1~ST*270*0001~BHT*0022*13*REPW*20030521*1614~HL*1**20*1~NM1*PR*2*MASSACHUSETTS MEDICAID*****PI*MASS XIX DMA~HL*2*1*21*1~NM1*1P*2******SV*1309927~REF*JD*USERID~REF*EL*PCX022200022P~HL*3*2*22*0~NM1*IL*1*XXXXXXXXXX*X****MI*", MEMBER, "~REF*GH*000000000001~DTP*307*D8*", DATE, "~EQ*30~SE*14*0001~GE*1*1~IEA*1*000000905~") > "/mnt/revs/LIST" MONTH DAY ".txt"
}
}
[/code]

THANKS!

Comments

  • You can run perl on windows using activesateperl:

    www.activestate.com

    but you can't run linux/unix shell scripts on windows. Maybe there is linux emulation software you can install on windows to run stuff like awk, but I don't know of it myself. But perl can handle all if not most of the awk stuff using perl functions.
  • I made it happen real easily. I just installed gawk the windows version of awk and was able to write a quick .bat file to run the awk program.

    thanks!


    : You can run perl on windows using activesateperl:
    :
    : www.activestate.com
    :
    : but you can't run linux/unix shell scripts on windows. Maybe there is linux emulation software you can install on windows to run stuff like awk, but I don't know of it myself. But perl can handle all if not most of the awk stuff using perl functions.
    :

  • [b][red]This message was edited by KevinADC at 2006-2-18 21:52:49[/red][/b][hr]
    : I made it happen real easily. I just installed gawk the windows version of awk and was able to write a quick .bat file to run the awk program.
    :
    : thanks!


    gawk huh? I'll have to remember that, thanks for posting back :)


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories