Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
static def removeLines(String filename, int startingLine, int lineCount) {
|
||||
def sourceFile = new File(filename).getAbsoluteFile()
|
||||
def outputFile = File.createTempFile("remove", ".tmp", sourceFile.getParentFile())
|
||||
|
||||
outputFile.withPrintWriter { outputWriter ->
|
||||
sourceFile.eachLine { line, lineNumber ->
|
||||
if (lineNumber < startingLine || lineNumber - startingLine >= lineCount)
|
||||
outputWriter.println(line)
|
||||
}
|
||||
}
|
||||
|
||||
outputFile.renameTo(sourceFile)
|
||||
}
|
||||
|
||||
removeLines(args[0], args[1] as Integer, args[2] as Integer)
|
||||
Loading…
Add table
Add a link
Reference in a new issue