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

[Clip] Re: Rename many files clip ...

Expand Messages
  • abairheart
    ... the two ... out ... I don t know if the ^$GetFiles function is missing from any NoteTab versions. If yes, it s time to fork over the measly twenty bucks
    Message 1 of 7 , Oct 14, 2005
      >
      > What I have are situations like such as 50 files each named with
      the two
      > letter US State abbreviation, that I need to rename to the spelled
      out
      > state name.
      >

      I don't know if the ^$GetFiles function is missing from any NoteTab
      versions. If yes, it's time to fork over the measly twenty bucks for
      the PRO version.

      To find a function, use the SECOND entry in NoteTab's HELP menu.
      Click on the Index tab, enter the function name (including the "^$"
      preceding it) into the window and press ENTER. If you don't get a
      match, start removing letters from the ned of the function. Or scroll
      through the index list.

      Never mind all the DOS stuff. IF you can predict, where the state
      abbreviation is located in the filename, and what the rest of the
      filename is (for example "XX_pattern.dat", where XX is the state
      abbreviation) you can use NoteTab to rename the files.

      You'll have to build two arrays, associated with each other by their
      index. One array to hold the state abbreviation, the other the full
      name.

      Then loop through the states, generate the current filename in the
      clip, then find the file that matches it, and rename it with
      NoteTab's rename function. Something like the following (I don't
      have NoteTab handy):

      ^!Set %pattern%=non-state-code-part-without-extension
      ^!Set %path%=^?{(T=D)Browse to the desired folder}
      ^!Set %ext%=^?{type the file extension w/o the period}
      ^!Set %i%=0
      :LOOP
      ^!Inc %i%
      ^!Set %oldname%=^%stateCode^%i%%^%pattern%.^%ext%
      ^!Set %newname%=^%stateName^%i%%^%pattern%.^%ext%
      ^!IfFileExist ^%path%^%oldname% SKIP
      ^!Goto ERROR
      ^!Rename ...
      ^!If ^%i%<50 LOOP
      ^!Goto END

      :ERROR
      whatever

      You'll have to look at the code, fill in what's missing, and change
      it to suit yourself.


      Abair
    Your message has been successfully submitted and would be delivered to recipients shortly.