{"record":{"id":"248d875c402f4d1c","repo":"stanfordnlp/CoreNLP","slug":"skipping-excluded-file","errorCode":null,"errorMessage":"Skipping excluded file ","messagePattern":"Skipping excluded file ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/pipeline/StanfordCoreNLP.java","lineNumber":1256,"sourceCode":"    final String inputSerializerClass = properties.getProperty(\"inputSerializer\", serializerClass);\n    final String inputSerializerName = (serializerClass.equals(inputSerializerClass))? \"serializer\":\"inputSerializer\";\n\n    final String extension = properties.getProperty(\"outputExtension\", getDefaultExtension(outputFormat));\n    final boolean replaceExtension = Boolean.parseBoolean(properties.getProperty(\"replaceExtension\", \"false\"));\n    final boolean continueOnAnnotateError = Boolean.parseBoolean(properties.getProperty(\"continueOnAnnotateError\", \"false\"));\n\n    final boolean noClobber = Boolean.parseBoolean(properties.getProperty(\"noClobber\", \"false\"));\n    // final boolean randomize = Boolean.parseBoolean(properties.getProperty(\"randomize\", \"false\"));\n\n    final MutableInteger totalProcessed = new MutableInteger(0);\n    final MutableInteger totalSkipped = new MutableInteger(0);\n    final MutableInteger totalErrorAnnotating = new MutableInteger(0);\n\n    //for each file...\n    for (final File file : files) {\n      // Determine if there is anything to be done....\n      if (excludeFiles.contains(file.getName())) {\n        logger.err(\"Skipping excluded file \" + file.getName());\n        totalSkipped.incValue(1);\n        continue;\n      }\n\n      //--Get Output File Info\n      //(filename)\n      String outputDir = baseOutputDir;\n      if (baseInputDir != null) {\n        // Get input file name relative to base\n        String relDir = file.getParent().replaceFirst(Pattern.quote(baseInputDir), \"\");\n        outputDir = outputDir + File.separator + relDir;\n      }\n      // Make sure output directory exists\n      new File(outputDir).mkdirs();\n      String outputFilename = new File(outputDir, file.getName()).getPath();\n      if (replaceExtension) {\n        int lastDot = outputFilename.lastIndexOf('.');\n        // for paths like \"./zzz\", lastDot will be 0","sourceCodeStart":1238,"sourceCodeEnd":1274,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/StanfordCoreNLP.java#L1238-L1274","documentation":"When running StanfordCoreNLP from the command line over a file list (filelist/ -filelist mode), any file whose name appears in the 'excludeFiles' set (regex 'exclude.files.pattern' or similar) is logged as skipped and not annotated. It is an informational skip, not a failure.","triggerScenarios":"Running java -cp ... StanfordCoreNLP -filelist list.txt -exclude.files.pattern \"regex\" where a file in the list matches the exclusion pattern; StanfordCoreNLP(FileListProcessor-style run) iterates files and calls logger.err with this message.","commonSituations":"Intentionally excluding output/intermediate files placed in the same directory; accidental matches because the exclusion regex is broader than expected, so input files you wanted get skipped.","solutions":["If the file should be processed, adjust -exclude.files.pattern so it no longer matches","Remove the excluded file from the -filelist","Move excluded/auxiliary files into a separate directory","Total skipped count is printed at end; check it matches expectations"],"exampleFix":"// before\n-exclude.files.pattern \".*tmp.*\"\n// after\n-exclude.files.pattern \"output_dir/.*\"","handlingStrategy":"validation","validationCode":"// before running, simulate the exclusion check\nSet<String> exclude = buildExcludeFiles(props);\nfor (File f : files) {\n    if (exclude.contains(f.getName())) System.err.println(\"will be skipped: \" + f);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep exclusion regexes narrow and test them against your filelist","Separate input and auxiliary/output files into different directories"],"tags":["cli","file-processing","skip"],"backgroundTag":"file-excluded-by-pattern","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}