Apply a process to multiple files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
gibdemaffenzucker
Posts: 3
Joined: 14 Jul 2010 23:55

Apply a process to multiple files

#1 Post by gibdemaffenzucker » 15 Jul 2010 00:03

Hi guys,

I need your help really urgently: I want to edit multiple files using the little programm AtomicParsley (http://atomicparsley.sourceforge.net/).

The term I want to apply to my files is

Code: Select all

atomicparsley PATHTOFILE --manualAtomRemove "moov.udta.meta.ilst.apID"


What I thought about is pointing the bat to a folder which contains my files and all of which should be applied that line of code above.

Can you please help me?

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Apply a process to multiple files

#2 Post by aGerman » 15 Jul 2010 05:31

I will not download this tool for tests because I dont need it.
You could run it in a FOR loop.
Untested:

Code: Select all

pushd "c:\your folder"
for %%a in (*.ext) do %~dp0atomicparsley "%%~fa" --manualAtomRemove "moov.udta.meta.ilst.apID"
popd

You have to change c:\your folder and *.ext.

Regards
aGerman

gibdemaffenzucker
Posts: 3
Joined: 14 Jul 2010 23:55

Re: Apply a process to multiple files

#3 Post by gibdemaffenzucker » 15 Jul 2010 08:39

great! thanks! works like a charm :mrgreen:

would it be possible to choose the path each time the batch is being run? (instead of having to change it in the source)

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Apply a process to multiple files

#4 Post by aGerman » 15 Jul 2010 11:13

Of course. What about SET /P?

Code: Select all

@echo off &setlocal
set /p "folder=Enter your path: "
pushd "%folder%" ||goto :eof
for %%a in (*.ext) do "%~dp0atomicparsley.exe" "%%~fa" --manualAtomRemove "moov.udta.meta.ilst.apID"
popd

Note that you have to input the path without quotes (regardless if there are spaces or not).

Regards
aGerman

gibdemaffenzucker
Posts: 3
Joined: 14 Jul 2010 23:55

Re: Apply a process to multiple files

#5 Post by gibdemaffenzucker » 15 Jul 2010 23:26

perfectly! thank you very very much - this saves me days of work compared to editing all these files by hand.

Post Reply