Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Windows mass copy files with same name in differnt folders Post 302459911 by jville on Tuesday 5th of October 2010 03:06:14 PM
Old 10-05-2010
Windows mass copy files with same name in differnt folders

I have files existing with same names in the folders with date as display below
Code:
c:\2010-09-10    <==== folder
   arr1.jpg
   arr2.jpg
   arr3.jpg
   arr4.jpg
c:\2010-09-09   <==== folder
   arr1.jpg
   arr2.jpg
c:\2010-09-08     <==== folder
   arr2.jpg
   arr3.jpg
   arr4.jpg
   arr5.jpg
   arr8.jpg
   arr9.jpg
   arr10.jpg
   arr11.jpg
 c:\2010-09-07   <==== folder
   arr2.jpg
   arr3.jpg
   arr4.jpg
   arr10.jpg
   arr11.jpg
c:\2010-09-06  <==== folder
   arr9.jpg
   arr10.jpg
   arr11.jpg
c:\2010-09-05   <==== folder
   arr2.jpg
   arr3.jpg
   arr4.jpg
   arr5.jpg
   arr6.jpg
   arr7.jpg
   arr8.jpg
c:\2010-09-04  <==== folder
   arr2.jpg
   arr3.jpg
   arr5.jpg
   arr6.jpg
   arr7.jpg
   arr8.jpg
   arr9.jpg
   arr10.jpg
   arr11.jpg
c:\2010-09-03  <==== folder
  arr2.jpg
  arr3.jpg
  arr4.jpg
  arr5.jpg
  arr6.jpg
  arr7.jpg
  arr10.jpg
  arr11.jpg
c:\2010-09-02   <==== folder
 arr2.jpg
 arr3.jpg
 arr4.jpg
 arr5.jpg
 arr6.jpg
 arr7.jpg
 arr8.jpg
 arr11.jpg
c:\2010-09-01  <==== folder
 arr2.jpg
 arr3.jpg
 arr4.jpg

I would like to rename those files as <DATE>_<SrNo>.jpg. and move all the files in single folder called All_pics
The SrNo is a continous running number serial number.
Code:
C:\All_pics\
   2010-09-10_54.jpg   
   2010-09-10_55.jpg   
   2010-09-10_56.jpg  
   2010-09-10_57.jpg  
   
   2010-09-09_52.jpg  
   2010-09-09_53.jpg  
   2010-09-08_44.jpg  
   
   2010-09-08_45.jpg  
   2010-09-08_46.jpg  
   2010-09-08_47.jpg  
   2010-09-08_48.jpg  
   2010-09-08_49.jpg  
   2010-09-08_50.jpg  
   2010-09-08_51.jpg  
   
   2010-09-07_39.jpg  
   2010-09-07_40.jpg  
   2010-09-07_41.jpg  
   2010-09-07_42.jpg  
   2010-09-07_43.jpg  
   
   2010-09-06_36.jpg  
   2010-09-06_37.jpg  
   2010-09-06_38.jpg  
   2010-09-05_29.jpg   
   2010-09-05_30.jpg   
   2010-09-05_31.jpg   
   2010-09-05_32.jpg   
   2010-09-05_33.jpg   
   2010-09-05_34.jpg   
   2010-09-05_35.jpg   
   
   2010-09-04_20.jpg   
   2010-09-04_21.jpg   
   2010-09-04_22.jpg   
   2010-09-04_23.jpg   
   2010-09-04_24.jpg   
   2010-09-04_25.jpg   
   2010-09-04_26.jpg   
   2010-09-04_27.jpg   
   2010-09-04_28.jpg   
   
   2010-09-03_12.jpg   
   2010-09-03_13.jpg   
   2010-09-03_14.jpg   
   2010-09-03_15.jpg   
   2010-09-03_16.jpg   
   2010-09-03_17.jpg   
   2010-09-03_18.jpg   
   2010-09-03_19.jpg   
   
   2010-09-02_04.jpg   
   2010-09-02_05.jpg   
   2010-09-02_06.jpg   
   2010-09-02_07.jpg   
   2010-09-02_08.jpg   
   2010-09-02_09.jpg   
   2010-09-02_10.jpg   
   2010-09-02_11.jpg   
   
   2010-09-01_01.jpg  
   2010-09-01_02.jpg 
   2010-09-01_03.jpg

 

10 More Discussions You Might Find Interesting

1. Solaris

Copy Folders from Sun Solaris to Windows server.

Hi, I have a folder with diff subfolders in my Unix box and now I want to ftp all the floders into my Windows machine. Is there any easy way to do that. When I use the "mget " cmd and try to FTP the files, it throws an error that the sub folder name does not exist. Can you someone help in... (3 Replies)
Discussion started by: chandu_kalari
3 Replies

2. UNIX for Dummies Questions & Answers

copy all files and folders and cjange or remove ownership

So tried: cp -r -p test1/ user@machine:///srv/www/vhosts/domain.co.uk/httpdocs/backup/ but this didn't work either :( Anyone able to help with this? Many thanks Mr M (3 Replies)
Discussion started by: misterm
3 Replies

3. Windows & DOS: Issues & Discussions

Copy folders and subfolders from unix to windows

Sir From a unix machine some folders and their folders have to be copied to windows XP PC. Please help me with a batch file or a shell script. I am new to the the shell and batch files. Thanks in anticipation. sastry (3 Replies)
Discussion started by: chssastry
3 Replies

4. Shell Programming and Scripting

copy some files from users home folders to my folder

i have users home directories in /home all the users have some files starting with character e and i want to copy all these files in a folder in my (root) home using a script i tried the script for i in m5 do cd m5 cp e1* /home/pc/exam cd .. done but get these... (3 Replies)
Discussion started by: pcrana
3 Replies

5. Shell Programming and Scripting

I need script Copy permissions of files and folders from one server to another

Hi.. I have 2 servers with linux suse10. I made a mistake and on one of the servers changed with chmod the permission of root in directory /. In the other servers the permissions are correct Please i need a script, to change the permissions of one server 1, using the same permission of the... (11 Replies)
Discussion started by: ave-phoenix
11 Replies

6. UNIX for Dummies Questions & Answers

copy mutilple files to mutiple folders

Hi, I just started to learn shell progamming and just can't get my head around the following problem. I need to do the following: I have a folder which contains 100+ subfolders. Inside these subfolders there is one folder named 'Morph' and several jpg's. I need to copy all the files into... (4 Replies)
Discussion started by: M474746
4 Replies

7. Shell Programming and Scripting

Loop folders, delete files, copy new ones

Folks, I am hopeful that you may be able to help me out with writing a script that can be run nightly (as cron?) to loop through all subfolders within the "/media" directory, delete all of the files in each of them, and then copy in all of the files from the "/home//sansa" directory to each of... (6 Replies)
Discussion started by: acraig
6 Replies

8. Shell Programming and Scripting

Script to copy User home folders to mounted windows share

First of all, let me state that I am a windows admin. I have a windows share mounted to /mnt/server I need a script that will either login as sudo or perform commands with sudo rights. I need the script to copy all of the users /home folders to the mounted windows share. Now If I can... (7 Replies)
Discussion started by: EricM
7 Replies

9. HP-UX

Recursive copy of Folders with files

Dear All, I will appreciate any help received. Our system is running on hpux v1 My problem is as follows: We have many customer folders with name fd000100, fd000101 and so on e.g. (Testrun)(testsqa):/>ll /TESTrun/fd000100 total 48 drwxrwx--- 2 fq000100 test 96 Jun 27 2004... (17 Replies)
Discussion started by: mhbd
17 Replies

10. Shell Programming and Scripting

How to copy files/folders and show the files/folders?

Hi, So i know we use cp -r as a basic to copy folders/files. I would like this BUT i would like to show the output of the files being copied. With the amazing knowledge i have i have gone as far as this: 1) find source/* -exec cp -r {} target/ \; 2) for ObjectToBeCopied in `find... (6 Replies)
Discussion started by: Imre
6 Replies
folders(1)						      General Commands Manual							folders(1)

NAME
folders - list folders and contents (only available within the message handling system, mh) SYNOPSIS
folders [+folder] [msg] [options] OPTIONS
Lists only the name of folders, with no additional information. This is faster because the folders need not be read. Prints a list of the valid options to this command. Lists the contents of the folder-stack. No +folder argument is allowed with this option. Re-numbers mes- sages in the folders. Messages are re-numbered sequentially, and any gaps in the numbering are removed. The default operation is -nopack, which does not change the numbering in the folder. Discards the top of the folder-stack, after setting the current folder to that value. No +folder argument is allowed with this option. This corresponds to the popd operation in the C-shell; see csh(1). The -push and -pop options are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Pushes the current folder onto the folder-stack, and makes the +folder argument into the current folder. If +folder is not given, the current folder and the top of the folder-stack are exchanged. This corresponds to the pushd operation in the C-shell; see csh(1). The -push switch and the -pop switch are mutually exclusive: the last occurrence of either one overrides any previous occurrence of the other. Lists folders recur- sively. Information on each folder is displayed, followed by information on any sub-folders which it contains. Displays only the total number of messages and folders in your Mail directory. This option does not print any information about individual folders. It can be sup- pressed using the -nototal option. The defaults for folders are: +folder defaults to all msg defaults to none -nofast -noheader -nototal -nopack -norecurse DESCRIPTION
The folders command displays the names of your folders and the number of messages that they each contain. The folders command displays a list of all the folders in your Mail directory. The folders are sorted alphabetically, each on its own line. This is illustrated in the following example: Folder # of messages ( range ); cur msg (other files) V2.3 has 3 messages ( 1- 3). adrian has 20 messages ( 1- 20); cur= 2. brian has 16 messages ( 1- 16). chris has 12 messages ( 1- 12). copylog has 242 messages ( 1- 242); cur= 225. inbox+ has 73 messages ( 1- 127); cur= 127. int has 4 messages ( 1- 4); cur= 2 (others). jack has 17 messages ( 1- 17); cur= 17. TOTAL= 387 messages in 8 folders. The plus sign (+) after inbox indicates that it is the current folder. The information about the int folder includes the term (others). This indicates that the folder int contains files which are not messages. These files may be either sub-folders, or files that do not belong under the MH file naming scheme. The folders command is identical to the effect of using the -all option to the folder command. If you use folders with the +folder argument, it will display all the subfolders within the named folder. as shown in the following exam- ple: % folders +test Folder # of messages ( range ); cur msg (other files) test+ has 18 messages ( 1- 18); (others). test/testone has 1 message ( 1- 1). test/testtwo has no messages. TOTAL= 19 messages in 3 folders. See refile(1) for more details of sub-folders. RESTRICTIONS
MH does not allow you to have more than 100 folders at any level in your Mail directory. PROFILE COMPONENTS
Path: To determine your MH directory Folder-Protect: To set protections when creating a new folder Folder-Stack: To determine the folder stack lsproc: Program to list the contents of a folder FILES
The user profile. SEE ALSO
csh(1), folder(1), refile(1), mhpath(1) folders(1)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy