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

18197Re: [NTB] I'am stumped.

Expand Messages
  • hsavage
    Oct 9, 2005
    • 0 Attachment
      hotjobslogin wrote:
      > I'm hoping you can help me.
      > I have a number of folders that have many records in them.
      > The records are "file type" so there isn't an extention like .txt or
      > .html etc.
      >
      > I need to add a date and time starting in the first position of each
      > file in the folder.
      >
      > i.e. yyyymmddhhmmss|
      >
      > yyyy = year
      > mm = month
      > dd = day
      > hh = hour
      > mm = min
      > ss = sec
      > | = delimiter
      >
      > I want to do this in a batch mode.
      >
      > I have looked through all the clips >
      > Thank You

      hjli,

      You can download a renaming utility as DAVE recommends, they are very
      useful.

      If you only want to rename files in a folder by adding the time and date
      down to the second as a prefix the clip below will serve.

      It will operate in the folder you select, take care to select the
      correct folder, and will add the prefix to 'every' file in that folder.

      I don't know what you had in mind by listing the delimiter but the
      vertical bar is a forbidden character in filenames. I replaced it with
      an underscore_ as a date_name separator.
      ===========

      H="Date_Prefix"
      ^!SetWordWrap 0
      ^!Set %date%=^[yyyymmddhhnnss^]_
      ; enter your own starting folder instead of mine in next line
      ^!Set %file_path%=^?{(T=D)Choose Folder Containing Subject
      Files=C:\startfolder\subfolder\}
      ^!SetListDelimiter ;
      ^!Set %files%=^$GetFiles("^%file_path%";"*.*";name)$
      ^!If ^%files%=^%EMPTY% END
      ^!Set %files%=^$StrReplace("^%file_path%";^%empty%;^%files%;0;0)$
      ^!SetArray %files%=^%files%
      ^!Set %idx%=0; %cnt%=^%files0%
      :LOOP
      ^!Inc %idx%
      ;
      ^!RenameFile "^%file_path%^%files^%idx%%"
      "^%file_path%^%date%^%files^%idx%%"
      ;
      ^!If ^%idx% = ^%cnt% EXIT ELSE LOOP

      ==============
      ºvº
      05.10.09
      hrs > hsavage@...
    • Show all 2 messages in this topic