Batch to move files baed on a list with source and destination paths
Moderator: DosItHelp
Batch to move files baed on a list with source and destination paths
Hi all,
I am new to this Forum and Dos Batch processing.
I have to move a large ammount of images. I have a text file where the images are listed individually with their source path and their destination path. Something like this:
Input Output
C:\projectA\asia\image1 Y:\blue\image1
C:\africa\image2 Y:\account\image2
Is there any batch that allows me to move the images based on my text file.
Thanks a lot
I am new to this Forum and Dos Batch processing.
I have to move a large ammount of images. I have a text file where the images are listed individually with their source path and their destination path. Something like this:
Input Output
C:\projectA\asia\image1 Y:\blue\image1
C:\africa\image2 Y:\account\image2
Is there any batch that allows me to move the images based on my text file.
Thanks a lot
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Batch to move files baed on a list with source and destination paths
Is the line Input Output part of the file? Will the paths contain any spaces?
Re: Batch to move files baed on a list with source and destination paths
My guess is
- multiple space or tab delimited file without doublequotes but with potential spaces in either 'column'
- homework type project
Re: Batch to move files baed on a list with source and destination paths
ShadowThief wrote:Is the line Input Output part of the file? Will the paths contain any spaces?
Hi, the Input Output does not need to be in the file. The Paths do not have any spaces. Cheers.
Re: Batch to move files baed on a list with source and destination paths
I'll try that again…
When you say the Input Output does not have to be in the file, are you creating the file in such a way as you have control over its content?
If the file is as we see it on the forum board, and you're not including the column headers, all you need to do is run each line of the file with the word move in front of it.
- Is the file in columns separated by multiple spaces?
- Is the file in columns separated by horizontal tabs?
- Is the file in columns separated by a single space?
When you say the Input Output does not have to be in the file, are you creating the file in such a way as you have control over its content?
If the file is as we see it on the forum board, and you're not including the column headers, all you need to do is run each line of the file with the word move in front of it.
Re: Batch to move files baed on a list with source and destination paths
Compo wrote:I'll try that again…
- Is the file in columns separated by multiple spaces?
- Is the file in columns separated by horizontal tabs?
- Is the file in columns separated by a single space?
When you say the Input Output does not have to be in the file, are you creating the file in such a way as you have control over its content?
The file is a text file, it has currently headers and columns are semapared by a single space, but I can modify it needed.
Re: Batch to move files baed on a list with source and destination paths
From the command line.
With your header:Without your header:
From a batch file.
With your header:Without your header:
Change the path inside the parentheses to suit your requirements and try it on test contents first!
With your header:
Code: Select all
For /F "UseBackQ Skip=1 Delims=" %A In ("C:\Users\Oms\Test.txt") Do @Move %A
Code: Select all
For /F "UseBackQ Delims=" %A In ("C:\Users\Oms\Test.txt") Do @Move %A
From a batch file.
With your header:
Code: Select all
For /F "UseBackQ Skip=1 Delims=" %%A In ("C:\Users\Oms\Test.txt") Do Move %%A
Code: Select all
For /F "UseBackQ Delims=" %%A In ("C:\Users\Oms\Test.txt") Do Move %%A
Change the path inside the parentheses to suit your requirements and try it on test contents first!
Re: Batch to move files baed on a list with source and destination paths
Compo wrote:From the command line.
With your header:Without your header:Code: Select all
For /F "UseBackQ Skip=1 Delims=" %A In ("C:\Users\Oms\Test.txt") Do @Move %A
Code: Select all
For /F "UseBackQ Delims=" %A In ("C:\Users\Oms\Test.txt") Do @Move %A
From a batch file.
With your header:Without your header:Code: Select all
For /F "UseBackQ Skip=1 Delims=" %%A In ("C:\Users\Oms\Test.txt") Do Move %%A
Code: Select all
For /F "UseBackQ Delims=" %%A In ("C:\Users\Oms\Test.txt") Do Move %%A
Change the path inside the parentheses to suit your requirements and try it on test contents first!
Thanks a lot! It work perfectly
Re: Batch to move files baed on a list with source and destination paths
Oms wrote:The file is a text file, it has currently headers and columns are separated by a single space, but I can modify it needed.
Oms, I'm only commenting here that a script or program is pretty dumb and has exact commands to perform a task. If the programmer can't see what is inside the file then the script will usually fail when unexpected text is seen by the commands.
Shorter reply: make sure you give a full picture of the information when you ask questions for your future tasks.