Page 1 of 1 1
Topic Options
#26192 - 2002-07-31 10:51 AM copying files to dirs with date
belgarion Offline
Fresh Scripter

Registered: 2002-07-31
Posts: 6
So i have a disk with files. If a person starts the kix-file, files are automatically processed, but they have to be backed up in my backup-dir on my computer. So far I have:

$sdate = substr( @date, 9, 2 ) + substr( @date, 6, 2 ) + substr( @date, 1, 4 )
md "$sdate"
cd "$sdate" (this is still wrong)

the date is converted into a string, the dir is created, but i don't know how to get inside the directory, and how to copy these files to the diretory.

Thanx for the help

Top
#26193 - 2002-07-31 11:02 AM Re: copying files to dirs with date
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Belgarion,

Welcome to the board. Dave Eddings fan, I take it? Never read them myself, but they're supposed to be quite good.

Anyway, to business. I'm not sure I totally understand what you're trying to do - this early in the morning, I'm not blaming that on you! [Wink] - you have a script that processes some files for you, you want the processed files to be backed up to a folder that is created with the current date, presumably on your local machine - yes?

If I've misunderstood let me know - there are a couple of questions, such as where are these files coming from? Are they created by the kix script, or are they simply being processed by it? Could you post what you have already - as its often easier to see what's going on from the script itself!

Thanks,

Breaker

[ 31 July 2002, 11:03: Message edited by: Breaker ]
_________________________
================================================
Breaker


Top
#26194 - 2002-07-31 11:26 AM Re: copying files to dirs with date
belgarion Offline
Fresh Scripter

Registered: 2002-07-31
Posts: 6
It's actually a very easy problem, but I'm just starting with Kix.

Other people from my departement have to do payments, for this they insert a floppydisk with the files in the computer.

copy a:\*.* c:\isabel\betalingen
cd\
cd isabel
cd betalingen
ren *.* *.fbf
cd\
cd backup
KIX32 SORTDATE.KIX

::SORTDATE.KIX
$sdate = substr( @date, 9, 2 ) + substr( @date, 6, 2 ) + substr( @date, 1, 4 )
md "$sdate"
cd "$sdate"

IF they start convert.bat a little program starts that copies the files, and then renames it, but the originals have to be backed up, not the altered files.

So it's basically just a problem on how to change a directory, and copy files from the floppydisk to my computer

Top
#26195 - 2002-07-31 11:28 AM Re: copying files to dirs with date
belgarion Offline
Fresh Scripter

Registered: 2002-07-31
Posts: 6
o and yes the name comes from david eddings
Top
#26196 - 2002-07-31 11:41 AM Re: copying files to dirs with date
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I would start by using full paths which removes the possible wrong path. also, all the copy and stuff can be achieved by kix so I made them all part of the script.
so your current script would be:
code:
copy a:\*.* c:\isabel\betalingen\*.fbf
$sdate = substr( @date, 9, 2 ) + substr( @date, 6, 2 ) + substr( @date, 1, 4 )
md "c:\backup\"+$sdate

now, if you want to copy files there use just copy command.

mm... I quess you have something more to this, don't you?
_________________________
!

download KiXnet

Top
#26197 - 2002-07-31 01:10 PM Re: copying files to dirs with date
belgarion Offline
Fresh Scripter

Registered: 2002-07-31
Posts: 6
SO now i have a kixfile with this in it:

Copy a:\*.* c:\isabel\betalingen\*.fbf
$sdate = substr( @date, 9, 2 ) + substr( @date, 6, 2 ) + substr( @date, 1, 4 )
md "c:\backup\"+$sdate
Copy a:\*.* "c:\backup\"+$sdate

But in the first line, it allready blocks.
Is it possible that it doesn't go because I'm working with windows 2000 PRO?

Top
#26198 - 2002-07-31 01:28 PM Re: copying files to dirs with date
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no... kix is working fine with all versions of windows. well, I've used it from up to 3.11 to w2k sp2 and other ppl are using with xp.
try it with:
Copy "a:\*.*" "c:\isabel\betalingen\*.fbf"
_________________________
!

download KiXnet

Top
#26199 - 2002-07-31 01:55 PM Re: copying files to dirs with date
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Is it correct that you want to change al extensions to .FBF in your first line of code?
Alos, try to copy to the directory by puuting a backslash at the end to denote a directory and not a file as in
code:
Copy 'a:\*.*' 'c:\backup\'+$sdate+'\'
? ''+@ERROR+' - '+@SERROR

and check the returned error code for success.

[ 31 July 2002, 14:03: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#26200 - 2002-07-31 02:00 PM Re: copying files to dirs with date
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what his bat code did the purpose was to change the extension.
and for that, the current syntax should correct.

but his latest reply has two copies from a which makes it reeeeeally slow.

if he wants to copy to two places he should copy first to other and then from there to the other one.
_________________________
!

download KiXnet

Top
#26201 - 2002-07-31 02:05 PM Re: copying files to dirs with date
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yeah, I know, but it never hurts asking.
_________________________
There are two types of vessels, submarines and targets.

Top
#26202 - 2002-07-31 03:04 PM Re: copying files to dirs with date
belgarion Offline
Fresh Scripter

Registered: 2002-07-31
Posts: 6
tnx guys, it works now

My collegues (ok wrong spelling i know, but I'm Dutch-speaking [Wink] ) will be forever gratefull

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1592 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.064 seconds in which 0.028 seconds were spent on a total of 11 queries. Zlib compression enabled.

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