Korn Shell Scripting

Clovertech Forums Read Only Archives Cloverleaf General Korn Shell Scripting

  • Creator
    Topic
  • #47888
    lisa sater
    Participant

      Hi,

      I am stuck on a script.  The process is pick up fileX (which contains the names of all the charge files created for 1 day).  I need to read the file names, write them to variables, so I can FTP the files over to the QDX Unix box for reformatting (perl) and then to process on QDX to a VRL format (output).

      An example of fileX:

      ./lisa/save/bill/MHT15421.dat

      ./lisa/save/bill/MHT27884.dat

      ./lisa/save/bill/MHT31008.dat

      Any suggestions would be helpful.

    Viewing 4 reply threads
    • Author
      Replies
      • #56993
        David Caragay
        Participant

          Lisa,

          Do you need to use a script to retrieve fileX and associated charge files?  If not, you may be able to use Cloverleaf functionality and a tcl proc to get the job done.

          Are you able to use the directory parse TPS option in the fileset-FTP protocol within Cloverleaf?  Since fileX contains a list of desired charge files, you should be able to write a dir parse tcl proc to pass Cloverleaf this list for processing.  

          You didn’t say where the dir file listing or the actual charge files are located.  If they are all stored in the same directory, the dir parse tcl proc would be passed a directory of file names (which would include your fileX) and then interrogate fileX.  Based on the data in fileX, the tcl proc would create a list of valid charge file names to pass back to cloverleaf for processing.  

          There are a number of different ways to code the tcl proc to meet just about any need.  All Cloverleaf wants returned from the dir parse tcl proc is a list of files you want to process.

          I usually try to use any built in Cloverleaf functionality before turning to external solutions.

        • #56994
          lisa sater
          Participant

            Hi,

            I am unable to use the features in Cloverleaf for getting these file.  The format of the HL7 charge file has the incorrect end of line and message terminaotrs, along with batch header and footers in the file.  

            So with K-shell I can pick up the files, then with perl I would reformat the file.  Then I can use the engine to process the data.

            Lisa

          • #56995
            Troy Morton
            Participant

              #!/usr/bin/ksh

              for myfile in `cat fileX`

              do

               

               FTP

               cd

               ASCII

               put $myfile

               quit

              done

            • #56996
              David Barr
              Participant

                Troy Morton wrote:

                #!/usr/bin/ksh

                for myfile in `cat fileX`

                do

              • #56997
                Kevan Riley
                Participant

                  Lisa,

                  Perhaps if you posted a snippet of you perl script we could help you translate it to Tcl.  You should be able to do anything you can do in Perl as an a Tcl proc in Inbound TPS in Cloverleaf.

                  Kevan Riley

                  Adventist Health System – IS

                  Lake Mary, FL

              Viewing 4 reply threads
              • The forum ‘General’ is closed to new topics and replies.