Unix/Linux Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

Move all files with pattern in filename

Windows & DOS: Issues & Discussions


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-28-2012   -   Original Discussion by pasc
pasc's Unix or Linux Image
pasc pasc is offline
Registered User
 
Join Date: May 2011
Last Activity: 14 June 2017, 7:09 AM EDT
Posts: 140
Thanks: 26
Thanked 1 Time in 1 Post
Move all files with pattern in filename

Well.

I would love to have a way to:

1.) search a folder, lets say: X:\Files
for any file that contains a "Conflict" in its filename (only!)
(recursively so it searches the whole contents of the folder)
2.) Move all files to another Folder.

All this under DOS.

Any help is appreciated.
Sponsored Links
    #2  
Old Unix and Linux 12-28-2012   -   Original Discussion by pasc
DGPickett's Unix or Linux Image
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
The built in windows command Find or FindStr mirrors the capabilities of the Unix command Grep.

'dir /B /S' will list all the files, and I gues /A-D to avoid directories.

I guess you could put them in a file and drive edit to convert the file into a bat full of copy commands.

You could get CygWin or the msdos gnu-like commands. UNIX Command Line Tools For MS-Windows XP / Vista / 7 Operating Systems

Last edited by DGPickett; 12-28-2012 at 04:57 PM..
Sponsored Links
    #3  
Old Unix and Linux 12-28-2012   -   Original Discussion by pasc
pasc's Unix or Linux Image
pasc pasc is offline
Registered User
 
Join Date: May 2011
Last Activity: 14 June 2017, 7:09 AM EDT
Posts: 140
Thanks: 26
Thanked 1 Time in 1 Post
Ok, so supposing I listed the files the way you said...

What would I then need to add in order to move the found files to another dir ?

xargs doesn't exist under windows so...
    #4  
Old Unix and Linux 12-28-2012   -   Original Discussion by pasc
DGPickett's Unix or Linux Image
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
To ensure reliability, copy one file per line:
Code:
copy <original_line> target_dir

Cygwin definitely has xargs and bash while read. I am not sure how close the others get. I bet you could put Cygwin on a flash drive and run it anywhere, despite the registry. Cygwin is essentially invoked as bash and everything unix-like happens inside there. Cygwin installs pretty simply if you have broadband. I use it a lot.
Sponsored Links
    #5  
Old Unix and Linux 12-28-2012   -   Original Discussion by pasc
pasc's Unix or Linux Image
pasc pasc is offline
Registered User
 
Join Date: May 2011
Last Activity: 14 June 2017, 7:09 AM EDT
Posts: 140
Thanks: 26
Thanked 1 Time in 1 Post
So essentially what you are saying is:

The thing I want to do is not possible under windows alone without cygwin ?

Meh too bad.

Thanks anyways.
Sponsored Links
    #6  
Old Unix and Linux 12-29-2012   -   Original Discussion by pasc
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 14 December 2017, 4:58 PM EST
Location: Saskatchewan
Posts: 22,547
Thanks: 1,159
Thanked 4,287 Times in 3,955 Posts
You can get busybox for windows which will have most of the usual commands contained in one exe file. No installation necessary at all.
The Following User Says Thank You to Corona688 For This Useful Post:
DGPickett (12-31-2012)
Sponsored Links
    #7  
Old Unix and Linux 12-31-2012   -   Original Discussion by pasc
DGPickett's Unix or Linux Image
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
Never say never. Driving edit with script might work. PERL is another direction that can help, but that's pretty close to going with VB, C, C++, JAVA. Busybox looks very interesting: BusyBox - The Swiss Army Knife of Embedded Linux

I got the w32 binary version of busybax, and it works really nice: http://dl.dropbox.com/u/5943991/busybox-w32/busybox.exe

Last edited by DGPickett; 01-02-2013 at 10:11 AM.. Reason: expans
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
move files according to dated filename igmox UNIX for Dummies Questions & Answers 2 05-03-2011 08:21 AM
Move files based on date in filename slatoms Shell Programming and Scripting 7 06-25-2010 10:20 PM
want to move files in a dir into different directories based on the filename Sriranga UNIX for Dummies Questions & Answers 2 03-10-2010 05:49 AM
how to move files into different folders based on filename italia5 UNIX for Dummies Questions & Answers 7 08-23-2006 11:04 AM



All times are GMT -4. The time now is 07:42 AM.