RE: how to generate unique file names on Windows.
This adds the time in fractions...
## uniquefile.bat##
@echo off
for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set pre=%%a%%b%%c_
FOR /F "TOKENS=5-8 DELIMS=:. " %%F IN ('ECHO.^|TIME') DO (
SET Hour=%%F
SET Mins=%%G
SET Secs=%%H
SET Mill=%%I)
set filename=yourPREFIX_%pre: =_%%Hour: =_%%Mins: =_%%Secs:
=_%%Mill:=_%.txt
##
hth
bob
I am trying to write a script on windows that would export the db every
night. Can someone tell me how to generate unique file names on
windows...
What I am looking for is the windows equivalent of echo `date +%m%d%y`
Thanks in advance.
Murali.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
INET: Murali_Pavuloori/[EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Bob Metelsky
INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Re: how to generate unique file names on Windows.
And people say Perl is cryptic.
Wolfgang Breitling <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
09/24/2003 11:59 AM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:
Subject: Re: how to generate unique file names on Windows.
for /F "tokens=2,3,4 delims=/ " %I in ('date /t') do @set today=%K-%I-%J
example:
c:\>date /t
Wed 09/24/2003
c:\>for /F "tokens=2,3,4 delims=/ " %I in ('date /t') do @set today=%K-%I-%J
c:\>echo %TODAY%
2003-09-24
c:\>
At 09:44 AM 9/24/2003 -0800, you wrote:
>Hello,
>
>I am trying to write a script on windows that would export the db every
>night. Can someone tell me how to generate unique file names on windows...
>
>What I am looking for is the windows equivalent of echo `date +%m%d%y`
>
>Thanks in advance.
>
>Murali.
>
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.net
>--
>Author:
> INET: Murali_Pavuloori/[EMAIL PROTECTED]
>
>Fat City Network Services -- 858-538-5051 http://www.fatcity.com
>San Diego, California -- Mailing list and web hosting services
>-
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Wolfgang Breitling
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
RE: how to generate unique file names on Windows.
> -Original Message- > From: Murali_Pavuloori/[EMAIL PROTECTED] > [mailto:Murali_Pavuloori/[EMAIL PROTECTED] > Sent: September 24, 2003 1:45 PM > To: Multiple recipients of list ORACLE-L > Subject: how to generate unique file names on Windows. > > > > Hello, > > I am trying to write a script on windows that would export > the db every > night. Can someone tell me how to generate unique file names > on windows... > > What I am looking for is the windows equivalent of echo > `date +%m%d%y` > > Thanks in advance. > > Murali. > Dynamically generated timestamp is what you want. Be warned though that this works only on Win2K and 'better': C:\>set zdate=_%date:~-4%%date:~7,2%%date:~4,2% C:\>set ztime=_%time:~0,2%%time:~3,2%%time:~6,2% C:\>echo %zdate%%ztime% _20030924_152452 On (not so) good ole NT4 this has to be done: :: === Create and initialize TIMESTAMP and NOW environment vars: :: set TIMESTAMP=_MMDD_HHMMSS :: set NOW=DD Month HH:MM:SS if EXIST SetTIMESTAMP.bat del /f /q SetTIMESTAMP.bat MakSetTIMESTAMPbat.wsf if exist SetTIMESTAMP.bat ( call SetTIMESTAMP.bat del /f /q SetTIMESTAMP.bat ) MakSetTIMESTAMPbat.wsf script dynamically creates SetTIMESTAMP.bat script. Execute that to create and initialize TIMESTAMP environment variable (mail me off-line if you want this script making script). Sooo much simpler/easier, more logical wouldn't you say than having to remember/worry about meaning of backticks in shell? Branimir -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Branimir Petrovic INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: how to generate unique file names on Windows.
Title: RE: how to generate unique file names on Windows.
IIRC (this is from memory)
type somefile.bat
for /f "tokens=1-4 delims=/ " %%a in ('date /t') do set newdate=%%b%%c%%d&
rename abc.txt abc.txt_%newdate%
this will append mmdd to the file but it will work in batch file only.
Raj
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !
-Original Message-
From: Khedr, Waleed [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 24, 2003 3:15 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: how to generate unique file names on Windows.
You can use sqlplus to generate the script for you.
-Original Message-
[mailto:Murali_Pavuloori/[EMAIL PROTECTED]]
Sent: Wednesday, September 24, 2003 1:45 PM
To: Multiple recipients of list ORACLE-L
Hello,
I am trying to write a script on windows that would export the db every
night. Can someone tell me how to generate unique file names on windows...
What I am looking for is the windows equivalent of echo `date +%m%d%y`
Thanks in advance.
Murali.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
INET: Murali_Pavuloori/[EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Khedr, Waleed
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
This e-mail
message is confidential, intended only for the named recipient(s) above and may
contain information that is privileged, attorney work product or exempt from
disclosure under applicable law. If you have received this message in error, or are
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000
and delete this e-mail message from your computer, Thank
you.*2
RE: how to generate unique file names on Windows.
You can use sqlplus to generate the script for you. -Original Message- [mailto:Murali_Pavuloori/[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 1:45 PM To: Multiple recipients of list ORACLE-L Hello, I am trying to write a script on windows that would export the db every night. Can someone tell me how to generate unique file names on windows... What I am looking for is the windows equivalent of echo `date +%m%d%y` Thanks in advance. Murali. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: Murali_Pavuloori/[EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Khedr, Waleed INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: how to generate unique file names on Windows.
for /F "tokens=2,3,4 delims=/ " %I in ('date /t') do @set today=%K-%I-%J
example:
c:\>date /t
Wed 09/24/2003
c:\>for /F "tokens=2,3,4 delims=/ " %I in ('date /t') do @set today=%K-%I-%J
c:\>echo %TODAY%
2003-09-24
c:\>
At 09:44 AM 9/24/2003 -0800, you wrote:
Hello,
I am trying to write a script on windows that would export the db every
night. Can someone tell me how to generate unique file names on windows...
What I am looking for is the windows equivalent of echo `date +%m%d%y`
Thanks in advance.
Murali.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
INET: Murali_Pavuloori/[EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Wolfgang Breitling
INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
how to generate unique file names on Windows.
Hello, I am trying to write a script on windows that would export the db every night. Can someone tell me how to generate unique file names on windows... What I am looking for is the windows equivalent of echo `date +%m%d%y` Thanks in advance. Murali. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: Murali_Pavuloori/[EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
