Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Clip] Saving files with variables

Expand Messages
  • hsavage
    ... extension ... Lee, Can you supply a short dirlist of real world filenames and a comparable list of what you want them to be after rtc, running the clip .
    Message 1 of 5 , Feb 5, 2006
      Lee Underwood wrote:
      > O.K., I found the previous one I had asked for. It's here below. But
      > I don't want to rename files, just add a different number. Can it
      > just be edited to do that? I can't really tell myself.
      >
      > Lee
      >
      > ...............................
      >
      > ; Define basic file-name, including drive and path but excluding
      extension
      > ^!Set %File%="e:\1-TNS\1-MAIN\daily"
      > ; Find highest numbered existing file
      > ^!RenameFile "^%File%.htm" "^%File%^%n%.htm"
      > :End
      >
      > ..............................
      >
      >
      > On 2/3/2006 11:25 AM, Lee Underwood wrote:
      > ........................................................
      >> What I want is, if there is already a file named "02-03-2006-1", it
      >> would name the next file "02-03-2006-2". I just can't seem to figure
      >> out how to get the clip to insert the number.
      >>
      >> Lee

      Lee,

      Can you supply a short dirlist of real world filenames and a comparable
      list of what you want them to be after rtc, 'running the clip'.

      ºvº
      06.02.05
      "Bathroom Etiquette I: Men Need Space in the Bathroom Cabinet Too."
      hrs ø hsavage@...
    • Bob McAllister
      ... Lee The smarts in the Clip you have lie in the use of IfFileExist while steadily increasing the value stored in %n%. That can be applied to your new task
      Message 2 of 5 , Feb 5, 2006
        On 2/4/06, Lee Underwood <leeu@...> wrote:
        > O.K., I found the previous one I had asked for. It's here below. But
        > I don't want to rename files, just add a different number. Can it
        > just be edited to do that? I can't really tell myself.
        >
        > ; Find highest numbered existing file
        > ^!Set %n%=0
        > ^!Inc %n%
        > ^!IfFileExist "^%File%^%n%.htm" Skip_-1
        > ; n is now 1 greater than highest numbered existing file

        Lee

        The "smarts" in the Clip you have lie in the use of IfFileExist while
        steadily increasing the value stored in %n%.

        That can be applied to your new task as below.

        ;SeqFileName based on date
        ^!Set %dir%=^?{(T=D)Directory=}
        ^!Set %basename%=^$GetDate(mm-dd-yyyy)$
        ^!Append %basename%=-
        ; Find highest numbered existing file
        ^!Set %n%=0
        ^!Inc %n%
        ^!IfFileExist "^%dir%^%basename%^%n%.txt" Skip_-1
        ; n is now 1 greater than highest numbered existing file
        ^!Save AS ^%dir%^%basename%^%n%.txt

        I have used a wizard in the first line to request the path to the
        directory. If you will always be using the same path, you can change
        it to
        ^!Set %dir%=G:\data\fileDir\

        Hope this helps

        Bob
      • Lee Underwood
        Bob, That s it exactly! It works great. Thanks! I can see what you mean ... variables are great! Lee On 2/6/2006 02:27 AM, Bob McAllister wrote: ...
        Message 3 of 5 , Feb 6, 2006
          Bob,

          That's it exactly! It works great. Thanks! I can see what you mean
          ... variables are great!

          Lee


          On 2/6/2006 02:27 AM, Bob McAllister wrote:
          ........................................................

          >Lee
          >
          >The "smarts" in the Clip you have lie in the use of IfFileExist while
          >steadily increasing the value stored in %n%.
          >
          >That can be applied to your new task as below.
          >
          >;SeqFileName based on date
          >^!Set %dir%=^?{(T=D)Directory=}
          >^!Set %basename%=^$GetDate(mm-dd-yyyy)$
          >^!Append %basename%=-
          >; Find highest numbered existing file
          >^!Set %n%=0
          >^!Inc %n%
          >^!IfFileExist "^%dir%^%basename%^%n%.txt" Skip_-1
          >; n is now 1 greater than highest numbered existing file
          >^!Save AS ^%dir%^%basename%^%n%.txt
          >
          >I have used a wizard in the first line to request the path to the
          >directory. If you will always be using the same path, you can change
          >it to
          >^!Set %dir%=G:\data\fileDir\
          >
          >Hope this helps
          >
          >Bob
          ........................................................


          --
          No virus found in this outgoing message.
          Checked by AVG Anti-Virus.
          Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 2/4/2006
        Your message has been successfully submitted and would be delivered to recipients shortly.