PC Review


Reply
Thread Tools Rate Thread

How to copy files to 1 folder?

 
 
rod
Guest
Posts: n/a
 
      30th Mar 2008
Throughout my E drive I have 4,754 files
I wish to place in 1 folder.
They are spread over 10 years and each has a filename
that will be the same for a day of the month.

The only difference is their date modified

eg
1204.gbh 11/4/2003 9:30pm
1204.gbh 9/4/2002 8:45pm
etc

How may I copy these files to 1 dedicated folder?
is it possible without the copy command advising
do I wish to overwrite.




 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      30th Mar 2008

"rod" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Throughout my E drive I have 4,754 files
> I wish to place in 1 folder.
> They are spread over 10 years and each has a filename
> that will be the same for a day of the month.
>
> The only difference is their date modified
>
> eg
> 1204.gbh 11/4/2003 9:30pm
> 1204.gbh 9/4/2002 8:45pm
> etc
>
> How may I copy these files to 1 dedicated folder?
> is it possible without the copy command advising
> do I wish to overwrite.
>


I assume that your 4754 files are spread over different
folders. If so then you could use the following batch file:
#1 @echo off
#2 set Source=E:\My Files
#3 set Target=D:\My Folder
#4 if not exist "%Target%" md "%Target%"
#5
#6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt
#7 for /F "delims=" %%a in ('type c:\Files.txt') do echo copy /y "%%a"
"%Target%
#8 del c:\Files.txt

You must, of course, remove the line numbers before running the
batch file. You must also make sure that the target folder is not
located under the source folder, in order to avoid a circular copy
process. You need to remove the word "echo" in Line #7 in order
to activate the batch file. Note also that "DOS" is an operating system
introduced some 30 years ago. It is rarely used these days. What
you probably meant in your question is the "Command Prompt"
under Windows XP. DOS would not understand the above batch file.


 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      30th Mar 2008

Methinks you credit me with more understanding
than which I really posess.
I look forward to giving it a spin

Thanks very much for your time and effort
very much appreciated.
Rodney


"Pegasus (MVP)"

> I assume that your 4754 files are spread over different
> folders. If so then you could use the following batch file:
> #1 @echo off
> #2 set Source=E:\My Files
> #3 set Target=D:\My Folder
> #4 if not exist "%Target%" md "%Target%"
> #5
> #6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt
> #7 for /F "delims=" %%a in ('type c:\Files.txt') do echo copy /y "%%a"
> "%Target%
> #8 del c:\Files.txt
>
> You must, of course, remove the line numbers before running the
> batch file. You must also make sure that the target folder is not
> located under the source folder, in order to avoid a circular copy
> process. You need to remove the word "echo" in Line #7 in order
> to activate the batch file. Note also that "DOS" is an operating system
> introduced some 30 years ago. It is rarely used these days. What
> you probably meant in your question is the "Command Prompt"
> under Windows XP. DOS would not understand the above batch file.
>



 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      30th Mar 2008
> "Pegasus (MVP)"

Are you able to assist with another?

I have several thousand random file names
as before but I have redated them eg

200302121202.gbh etc

I need to remove the first 8 digits to return to the status quo

Can a batch file do this in a file of say 30?

Rod



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      30th Mar 2008

"rod" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> "Pegasus (MVP)"

>
> Are you able to assist with another?
>
> I have several thousand random file names
> as before but I have redated them eg
>
> 200302121202.gbh etc
>
> I need to remove the first 8 digits to return to the status quo
>
> Can a batch file do this in a file of say 30?
>
> Rod
>


I am unable to reconcile these two statements:
"I have several thousand random file names" and
"Can a batch file do this in a file of say 30?"

If, as you previously wrote, you are inexperienced
with batch files then I would like to you to pick up
some experience with the first batch file I wrote
for you, before I write yet another one.


 
Reply With Quote
 
PD43
Guest
Posts: n/a
 
      30th Mar 2008
"rod" <(E-Mail Removed)> wrote:

>> "Pegasus (MVP)"

>
>Are you able to assist with another?
>
>I have several thousand random file names
>as before but I have redated them eg
>
>200302121202.gbh etc
>
>I need to remove the first 8 digits to return to the status quo


google Bulk Rename Utility
 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      31st Mar 2008

"Pegasus (MVP)"
> I am unable to reconcile these two statements:
> "I have several thousand random file names" and
> "Can a batch file do this in a file of say 30?"
>
> If, as you previously wrote, you are inexperienced
> with batch files then I would like to you to pick up
> some experience with the first batch file I wrote
> for you, before I write yet another one.


OK, first I am assembling all the files going back ten years,
I have the files on an ext drive, CDRoms, floppies.

At one stage I was renaming the files with 19980203 date style
prefix as I was worried the "modified date " would alter
the other files lie in monthly folders hence my (30) request.

Once assemled on one drive, I'll carry out your batch.




 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      31st Mar 2008

"PD43"
>>I need to remove the first 8 digits to return to the status quo

>
> google Bulk Rename Utility


Thank you very much.
I have always used ACDSee for renaming,
however this time I need to remove data from the file name
which ACDSee will not do.




 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      31st Mar 2008

My first attempt failed
I set source E:\
took out line numbers
set target C:\My Folder (and created the folder)
took out echo in line 7
saved to a notepad named it test1.cmd

activated test1.cmd nothing happened



"Pegasus (MVP)"
> I assume that your 4754 files are spread over different
> folders. If so then you could use the following batch file:
> #1 @echo off
> #2 set Source=E:\My Files
> #3 set Target=D:\My Folder
> #4 if not exist "%Target%" md "%Target%"
> #5
> #6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt
> #7 for /F "delims=" %%a in ('type c:\Files.txt') do echo copy /y "%%a"
> "%Target%
> #8 del c:\Files.txt
>
> You must, of course, remove the line numbers before running the
> batch file. You must also make sure that the target folder is not
> located under the source folder, in order to avoid a circular copy
> process. You need to remove the word "echo" in Line #7 in order
> to activate the batch file. Note also that "DOS" is an operating system
> introduced some 30 years ago. It is rarely used these days. What
> you probably meant in your question is the "Command Prompt"
> under Windows XP. DOS would not understand the above batch file.
>



 
Reply With Quote
 
rod
Guest
Posts: n/a
 
      31st Mar 2008

"Pegasus (MVP)"

> #6 dir /s /b /a-d "%source%\*.gbh" > c:\Files.txt


With adjustment, can this work with a file name
other than using an extension?

Say I wanted any files with WUPH in the file name,
how would I set the wildcards?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files from folder and rename in destination folder burl_h Microsoft Excel Programming 0 31st Jan 2009 01:09 PM
Copy all files from a folder to another folder, recursively pamela fluente Microsoft C# .NET 10 20th Jul 2007 06:04 PM
Copy all files from a folder to another folder, recursively pamela fluente Microsoft VB .NET 10 20th Jul 2007 06:04 PM
Copying CD files to folder, then copy folder to another hard drive, explorer hangs zoner@cox.nospam.net Windows Vista File Management 1 31st Mar 2007 06:07 PM
How to copy 30 csv files from a folder to another folder =?Utf-8?B?ZGRpaWNj?= Microsoft Excel Programming 1 17th Jul 2005 09:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 AM.