Find files in a folder using Java
- by Sii
Hello, I'm new here so be kind to my stupidity :)
What I need to do if Search a folder say C:\example
I then need to go through each file and check to see if it matches a few start characters so if files start
temp****.txt
tempONE.txt
tempTWO.txt
So if the file starts with temp and has an extension .txt I would like to then put that file name into a File file = new File("C:/example/temp***.txt); so I can then read in the file, the loop then needs to move onto the next file to check to see if it meets as above.
I hope this makes sense, thanks for taking the time to view this I do apperciate it :)