Hi All,

i am here with a problem in file handling in java.

i need to search all the files on system with extention *.fdr. which are not less den one day old.
then i need to convert the selected file to csv which is perfomed by a command in dos(symanalyzer).
then i need to attach the csv file to mail .

can someone help me with the java code .

i have done some R&D and found that i can use the method "lastModified()".

Thanks and Regards

                                final String dosCommand = "cmd /c REN *docx  *txt /s ";
                                final String location = "D:\\test";
          try {
                                final Process process =  Runtime.getRuntime().exec(
                                        dosCommand + " " + location);
                                final InputStream in = process.getInputStream();
                                int ch;
                                    while((ch = in.read()) != -1)
           } catch (IOException e)
                      // e.printStackTrace();

i am done with the first req i.e. i found out the files with curent date modifed .
now i want to use those files in batch command.
i have tried the above for executing batch command but i cant get any output from this.
instead of Ren command DIR command is working .

Do anyone have idea how to execute batch command in java.


This article has been dead for over six months. Start a new discussion instead.