Page 2 of 2 <12
Topic Options
#42969 - 2003-07-17 05:16 PM Re: Archiving Files Append Date/Time Stamp
Paul Hutchins Offline
Fresh Scripter

Registered: 2003-07-17
Posts: 9
Loc: London, England
So where would the following fit in my script?

code:
  
$datetime=join(split(@DATE,'\'),'-')+join(split(@TIME,':'),'-')


Top
#42970 - 2003-07-17 05:22 PM Re: Archiving Files Append Date/Time Stamp
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
paul, time stamp?
uuh.
you will end up with zillions of files.
just change:
code:
Copy "C:\new\FIXServer.log" "C:\new\FIXServer@mdayno.@monthno.@year.log"

to:
code:
Copy "C:\new\FIXServer.log" "C:\new\FIXServer@year.@monthno.@mdayno_"+join(split(@time,":"),"").log"

notice, I rechanged your year-month-day order back to what it was.
quess why?
because, once you have lot of those files, they will be automatically listed in correct order according to age.
_________________________
!

download KiXnet

Top
#42971 - 2003-07-17 05:25 PM Re: Archiving Files Append Date/Time Stamp
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
$datetime=join(split(@DATE,'\'),'.')+'-'+join(split(@TIME,':'),'.')
Copy 'C:\new\FIXServer.log' 'C:\new\FIXServer'+$datetime+'.log'

However,take a look at the UDF Forum with regards to filename UDFs and write a more generic routine that does not hardcode the filename.

You might also want to search the KiXtart BBS as these things have been discussed before.
_________________________
There are two types of vessels, submarines and targets.

Top
#42972 - 2003-07-17 05:37 PM Re: Archiving Files Append Date/Time Stamp
Paul Hutchins Offline
Fresh Scripter

Registered: 2003-07-17
Posts: 9
Loc: London, England
I am using Kix32.exe v3.54.0.0, will this make a difference to the syntax as I have an error.

Also, the output file produced is FIXServer2003.7.17_join

code:
  
If 1=Exist("C:\new\FIXServer.log")
Copy "C:\new\FIXServer.log" "C:\new\FIXServer@year.@monthno.@mdayno_"+Join(Split(@time,"_"),"").log"
If @error
? "error occured: @error - @serror"
? "script will exit once you press a key"
Get $
Exit 1
EndIf
EndIf


Top
#42973 - 2003-07-17 05:39 PM Re: Archiving Files Append Date/Time Stamp
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
LOL

Why does it always take until the 24th post to divulge what version you run? Check the manual! Much of what was suggested is not supported with that old a version.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#42974 - 2003-07-17 05:40 PM Re: Archiving Files Append Date/Time Stamp
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure it makes.
split() needs something like 4.0x and join() needs 4.10
_________________________
!

download KiXnet

Top
#42975 - 2003-07-17 05:49 PM Re: Archiving Files Append Date/Time Stamp
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
And UDFs are then also not supported.
_________________________
There are two types of vessels, submarines and targets.

Top
#42976 - 2003-07-17 06:36 PM Re: Archiving Files Append Date/Time Stamp
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well then: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=005218#000002

Just add the second line using @time - if that is supported in your version.

[ 17. July 2003, 18:37: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.063 seconds in which 0.032 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org