Jump to content

Batch File Programming - Please help me out - Character limit?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
jpena323

jpena323

    Newbie

  • Members
  • Pip
  • 1 posts
Okay,

First let me thank you guys in advance for any help you can give me! I have been stuck trying to figure this batch file code for a few days and it's driving me to the brink of insanity!!!!

I've been trying to write a batch file that will allow a user to enter a 3 character date (Julian date) which will rename a list of files to that 3 character extension, then move those files to a different folder. I have the batch file written and it works perfectly, however... I can't seem to figure out how to ensure that the input by the operator is a valid Julian date (this would be anything from 001 to 365).

Here is a sample of the code:

C:
cd \Test
SET /P DDD=What is the Julian date?
ren *.txt *.%DDD%

Right after the user inputs the Julian date, I need the test.. but nothing is working. I thought this might do it, but no luck...

if not "%ddd%" == "???" goto err1

the wildcard symbol won't work either. It seems like it should be easier, but i'm completely stuck. If anybody can help me with writing an if statement that basically limits the input to 3 characters and makes sure the the input is less than 365 I would be super grateful!!!

Thank you,
-JT

#2
Slider

Slider

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
This newsgroup can help you.

Andy

alt . msdos . batch . nt





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users