Rename file output

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Rename file output

  • Creator
    Topic
  • #50390
    April Dunbar
    Participant

      I am looking for suggestions on how to take a certain file name (LawsonJE.txt) at a certain time (say 5am daily) and rename the file (LawsonJE.20081016).   That way shortly after midnight the next morning, the hl7 messages can start writing to a new file (LawsonJE.txt).

      Thanks,

      April Dunbar

    Viewing 2 reply threads
    • Author
      Replies
      • #65934
        Dinakar Desai
        Participant

          Try the following in your script.

          tcl>set a “LawsonJE.txt”

          LawsonJE.txt

          tcl>set b [file rootname $a]

          LawsonJE

          tcl>set c “$b.[clock format [clock seconds] -format “%Y%m%d”]”

          LawsonJE.20081016

          tcl>

          Let me know, if you need more information.

          Dinakar

        • #65935
          April Dunbar
          Participant

            Hi Dinakar,

            Yes more information would be very helpful.  Where would I set something like this up in?  To change the file name everyday.  Do you have a tcl where you performed something similar?

            Thanks, April

          • #65936
            Dinakar Desai
            Participant

              whichever process writes to file knows the file name. That process can rename the file as soon the date changes. There are many ways of doing this. You have to choose the best method that suits your needs.

              I do not know how you are writing to file.

              If you give more details, I may be able to help you.

              Thank you.

              Dinakar

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