python or bash script to pass all files in a folder to java command line
I have the following Java command line working fine Mac os. java -cp stanford-ner.jar edu.stanford.nlp.process.PTBTokenizer file.txt > output.txt Multiple files can be passed as input with spaces as follows. java -cp stanford-ner.jar edu.stanford.nlp.process.PTBTokenizer file1.txt file2.txt > output.txt Now I have 100 files in a folder. All these files I have to pass as input to this command. I used python os.system in a for loop of directories as follows . for i,f in enumerate(os.listdir(filedir)): os.system('java -cp "stanford-ner.jar" edu.stanford.nlp.process.PTBTokenizer "%s" > "annotate_