RE: System for naming graphics files

Subject: RE: System for naming graphics files
From: "Lauren" <lauren -at- writeco -dot- net>
To: "'Dan Goldstein'" <DGoldstein -at- riverainmedical -dot- com>, <techwr-l -at- lists -dot- techwr-l -dot- com>
Date: Thu, 15 Jan 2009 12:59:09 -0800

> From: Dan Goldstein

> The following command at the command prompt adds the current
> date to all
> jpg files in the current directory that begin with "pic":
> ren pic*.jpg "pic*%date:/=%.jpg"
> So:
> pic_pretty_sunset.jpg
> becomes
> pic_pretty_sunset.jpgThu 011509.jpg
> pic_ugly_politician.jpg
> becomes
> pic_ugly_politician.jpgThu 011509.jpg
> How could we turn that MMDDYY into YYYYMMDD, as David suggests below?


ren *.txt "*%date:~10,4%%date:~4,2%%date:~7,2%.txt"

"txt" of course is whatever extension you want to change. Save this command
in a text file in the directory of the filenames to change and change the
extension "txt" to "cmd". Run the command file, <whatever you called
it>.cmd, from the command prompt. So for "test.cmd", enter "test" after the
command prompt.

A similar script can be made with time. See,

You should notice that the number after the tilde refers to the character
position in the date string and the number after the comma is the number of
digits before that position. UNIX is so much better at handling strings and



ComponentOne Doc-To-Help 2009 is your all-in-one authoring and publishing
solution. Author in Doc-To-Help's XML-based editor, Microsoft Word or
HTML and publish to the Web, Help systems or printed manuals.

Help & Manual 5: The complete help authoring tool for individual
authors and teams. Professional power, intuitive interface. Write
once, publish to 8 formats. Multi-user authoring and version control!

You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit

To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit for more resources and info.

Please move off-topic discussions to the Chat list, at:


RE: System for naming graphics files: From: Dan Goldstein

Previous by Author: RE: Omaha
Next by Author: RE: System for naming graphics files
Previous by Thread: RE: System for naming graphics files
Next by Thread: RE: System for naming graphics files

What this post helpful? Share it with friends and colleagues:

Sponsored Ads