Newbie!Loop through files,execute a prog,write on a txt file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Jurafsky
Posts: 1
Joined: 27 Oct 2015 06:33

Newbie!Loop through files,execute a prog,write on a txt file

#1 Post by Jurafsky » 27 Oct 2015 06:40

Hello all,
I'm a newbie on batch. I'm trying to use a pos tagger called treetagger without using the UI.
I would like to write a good batch script in order to:

- look to a directory where there are my files .txt
- loop through them and execute the treetagger program
- write every time the result in a new text file with the same name of the original one + "TTG".

This is my code stored in a batch file, in the Treetagger bin directory with the text files:

Code: Select all

@echo off

for %%f in (*.*) do
    tag-french %%f
    echo >> t_res.txt
pause

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Newbie!Loop through files,execute a prog,write on a txt

#2 Post by Squashman » 27 Oct 2015 06:49

FYI, this question was originally started on SO.
http://stackoverflow.com/questions/3335 ... -on-them-a

Post Reply