| 1. |
Solve : [solved] Batch processing text files? |
|
Answer» Hello, %i_done.txt Why has it only got one % SIGN? that would be an errorQuote from: smeezekitty on August 20, 2009, 03:34:10 PM that would be an error Quote What i do wrong? There may be othersI try to achieve such goal: Take all text files from input directory and let some java program do it's work. But this program must have defined in and out. It works fine with commands: Code: [Select]java -jar somefile.jar -i C:\input_dir\file1.txt -o C:\output_dir\file_done.txt java -jar somefile.jar -i C:\input_dir\file1.txt > C:\output_dir\file_done.txtI cannot do: Code: [Select]java -jar somefile.jar -i C:\input_dir\*.txtbecause output is not specified or produces 0 byte output for *.txt which for me it's useless. I need put processed files into different directory with maybe changed names. Does the closing parenthesis MEANS: Code: [Select](java -jar D:\java\somefile.jar -i %%i -o %%i_done.txt) I guess not...did it work or not? i am confused Well, the only thing that works is command in cmd: Code: [Select]for %i in (c:\input\*.txt) do java -jar somefile.jar -i %i > %i_done.txtBut if it works in cmd i don't care how to write it in batch file - thanks for all replies. Quote from: Lu on December 18, 1973, 10:18:07 AM Well, the only thing that works is command in cmd:Take your code, add @echo off on a line above it and paste it into notepad. Save it as myscript.bat and there you go!Quote paste it into notepad. Save it as myscript.bat Don't forget to change %i to %%i |
|