On Nov 11, 11:26*am, Noel <brincatn...@gmail.com> wrote:
> Dear all
>
> I was succesful in using a text tagging program from java and also
> gather its output. However it only functions when I use it for small
> files (3k), when I use it for slightly larger text files (8k) it does
> not work. If I use the program directly from the command prompt it
> works for files of any size.
>
> The problem does not lie within the 'type' dos command, as my java
> program still lists the big file.
>
> Here is the code
>
> Runtime rt = Runtime.getRuntime();
> Process pr = rt.exec("cmd /c type c:\\NLP\\EXAMPLES\\Text | c:\\NLP\
> \bin\\nlp.cmd -show_tags");
>
> InputStream inStd = pr.getInputStream();
> InputStreamReader inStdR = new InputStreamReader(inStd);
> BufferedReader bStd = new BufferedReader(inStdR);
>
> String line=null;
>
> while((line=bStd.readLine()) != null)
> {
> * * * * System.out.println(line);
>
> }
>
> Does anyone know why big files cannot be tagged from java, but can be
> tagged from the command prompt.
>
> Thanks
> N
It worked on my computer, with data file of 15Kb.
I used Process pr = rt.exec("cmd /c type c:\\delmelab\\a.txt | grep
';'"); here I am using grep of cygwin environment, may be the batch
script you are using causing the problem.
Will you able to share the script to try the same in our environment.
|