Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Increment file names of copied file  (Read 3261 times)

0 Members and 1 Guest are viewing this topic.

Brian Wisnor

  • Guest
Increment file names of copied file
« on: August 02, 2004, 01:22:12 PM »
I am not a programmer, but needed to perform some simple move and copy functions to manage our EDI files.  In one step, multiple incoming Purchase Order files are batched into one file, say inbound.edi, which is sent to our ERP system for processing.  Since this file will be overwritten the next time we pick up new files, I would like to copy the file to a backup directory.  Obviously, I can't keep a copy of each unless their filename is somehow changed or appended incrementally.  Is there a command to increment the file name during a copy so each copy is uniquely named in the new directory?  (Similar to date-time stamp question, but does not necessarily have to be date-time stamp - could just be sequential numbering).
THANK YOU! - Brian

franksimari

  • Guest
Re: Increment file names of copied file
« Reply #1 on: November 29, 2004, 09:23:20 PM »
try this..it may be clunky and depending on the size of your files
make a dummy file called   dumm
then add your first file , firstf to dumm by

copy   dumm+firstf

i do  not how to get rid of the copy (y/n/etc) but in earlier versions of dos the question does not appear

it will add to dumm

the next  time  you can add secondf

or it can still be called firstf (in case you are spooling out the directions to someone else)

you use
copy  dumm+ secondf



and dumm will have both firstf and secondf

the only other way i know how to do this is a simple routine using dbase or clipper


8)

viking



    Adviser
  • miaow-miaow 2.0 for networks
  • Thanked: 1
    Re: Increment file names of copied file
    « Reply #2 on: November 30, 2004, 11:28:28 AM »
    I can't see other solution than a small program... In C, in Java, but you have to talk to someone to help you with that. It's easy to do. I don't know to do that using Windows command line tools.