Skip to content

Instantly share code, notes, and snippets.

@osima
Created June 3, 2011 10:11
Show Gist options
  • Select an option

  • Save osima/1006133 to your computer and use it in GitHub Desktop.

Select an option

Save osima/1006133 to your computer and use it in GitHub Desktop.
get txt filelist
def getTxtFileList = { dir->
def list=[]
dir.listFiles( { it.name.endsWith('.txt') } as FileFilter ).each{ list.add(it) }
list
}
getTxtFileList(new File('.')).each{ println it }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment