Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying files to different location, a naming problem.

Status
Not open for further replies.

lasd

Programmer
Jan 14, 2005
48
0
0
IE
Hi

I hope someone can help again. I am attaching the piece of code i am using to copy files from the components.path field over to another file in a different location. I am using a .bat file to copy over the documents. But where i am stuck is that i want to add in the creation date to be part of the name for the file i am copying over to.
for eg. copy file
1235@2.tif over to a file called 1235@2.5
but what i want to happen is
copy file
1235@2.tif over to a file called 12-09-2005-1235@2.tif
i just want to add in the creation date into the name of the file.
Can i do this. i want to add on profile.creation_date to the second components.path file in this code.but when i try it my syntax doesn't seem correct..

select 'Copy ' ||TRIM(components.path)
|| '' || TRIM(components.path)

thank you so much in advance for your help.
kindest regards
lasd
 
sorry made a mistake showing the first copy statemen.
it would be like this.
copy file || 1235@2.tif over to 1235@2.tif
 
Something like this ?
select 'Copy ' ||TRIM(components.path) || CURRENT_DATE || '' || TRIM(components.path

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks for that reply it worked perfectly. i am very grateful.
i was wondering if it is possible to do the following.
i am still copying the files but instead of naming them with the creation_date and component.path name i was wondering could i number them, say from 100000.tif up to the last file, which could be 120000.tif.

for eg. copy file
1235@2.tif over to a file called 100000.tif
and i want this to increment for each file
for eg. copy file
1236@2.tif over to a file called 100001.tif and so on for the next 20,000 files.
Is it an if statement or by using the count funtion.
your help really is appreciated
kindest regards
Lasd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top