2016-07-21 53 views
-3

我需要处理大量的简历。并且想使用这个解析器: https://github.com/antonydeepak/ResumeParser 但是你在powershell中用读取的文件和输出文件运行它。 但我不知道如何自动化,所以它读取包含简历的整个文件夹。如何将参数传递给预编译的java代码

我知道一些Java,但无法打开代码。在PowerShell中进行脚本编写的路要走吗?

谢谢!

+0

当然,您可以更改ResumeParser代码,或者实现一个小脚本来搜索文件夹结构中的文件,但我不知道最适合您需要的文件。 –

回答

0
> java -cp '.\bin\*;..\GATEFiles\lib\*;..\GATEFILES\bin\gate.jar;.\lib\*' 
    code4goal.antony.resumeparser.ResumeParserProgram <input_file> [output_file] 

要么从已编辑的目录列表中创建批处理文件,要么编写程序。 由于这是计算器:

所以用相同的类路径开始(-cp ......),你可以运行自己的程序

public void static main(String[] args) throws IOException { 
    File[] files = new File("C:/resumes").listFiles(); 
    File outputDir = new File("C:/results"); 
    outputDir.mkDirs(); 
    if (files != null) { 
     for (File file : files) { 
      String path = file.getPath(); 
      if (path.endsWith(".pdf")) { 
       String output = new File(outputDir, 
         file.getName().replaceFirst("\\.\\w+$", "") + ".json").getPath(); 
       String[] params = {path, output); 
       ResumeParserProgram.main(params); 

       // For creating a batch file >x.bat 
       System.out.println("java -cp" 
        + " '.\\bin\\*;..\\GATEFiles\lib\\*;" 
        + "..\\GATEFILES\\bin\\gate.jar;.\\lib\\*'" 
        + " code4goal.antony.resumeparser.ResumeParserProgram" 
        + " \"" + path + "\" \"" + output + "\""); 
      } 
     } 
    } 
} 

检查工作的,即ResumeParserProgram.main是重入的。

相关问题