steps {
node('master') {
script {
def files = findFiles glob: "*/test/*.*"
files.sort()
echo "${files[i].name}"
}
}
}
I have files inside test directory where filenames having a pattern test1.csv, test2.csv ... test100.csv, test101.csv etc.
When I use files.sort(), Jenkins prints test100.csv, test101.csv first and then test1.csv.
How to sort and print like test1, test2, test3 ... test100 etc.
Please advice.