Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi I have a folder containing many files , is there a way if i can just filter out or delete the files (which are
Hi I have a folder containing many files , is there a way if i can just filter out or delete the files (which are not in the list) according to a list of Strings which is a substring of the file names.
List of String,
ListfileListNames = Arrays.asList("bus_ticket","driver_trips","train_ticket");
the filenames inside the folder are like this
ABC_bus_device_20230118_20230119.xml
ABC_bus_ticket_20230118_20230119.xml
AET_driver_trips_20230118_20230119.xml
I only want this two files in the folder
ABC_bus_ticket_20230118_20230119.xml
AET_driver_trips_20230118_20230119.xml
Is there a filter out using Java code, please help thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started