Feb-21-2022, 04:56 PM
So i have a need to be able to search multiple CSV files for a string or set of strings and then return the file name that it was found in.
I want to keep it as general as possible so that the search can be performed for anything within the files.
All files will reside in 1 folder, because they are named with the dates in the file name like so:
Future_Matched_2022-02-19 to 2022-02-23.csv
Future_UnMatched_2022-02-19 to 2022-02-23.csv
The folder contains 2 files per day, all the way back to november, not that it matters, but to give context on how many files there currently are and to understand that there will be plenty more by the end of the year..
So my need is to build some script that i can plug in a value (numerical for this first iteration) 6 digit number
130062 example...
Using that number, i need to search each file in the folder, and if its found in any file, then provide a list of all the files that number was found in so we can pull those files out and investigate further.
so before i go down the rabbit hole of trying all sorts of things.. what should i start with? methods to consider and use?
What's most efficient for such a search? im not super concerned with speed now, but if i can script it so its quick now and later when there is a years worth of files to look thru that would be great.
Any guidance would be great on where or what i should consider to start with. Keeping in mind that i dont have to do anything else with the files, just need to find any files that contain the string provided.
I want to keep it as general as possible so that the search can be performed for anything within the files.
All files will reside in 1 folder, because they are named with the dates in the file name like so:
Future_Matched_2022-02-19 to 2022-02-23.csv
Future_UnMatched_2022-02-19 to 2022-02-23.csv
The folder contains 2 files per day, all the way back to november, not that it matters, but to give context on how many files there currently are and to understand that there will be plenty more by the end of the year..
So my need is to build some script that i can plug in a value (numerical for this first iteration) 6 digit number
130062 example...
Using that number, i need to search each file in the folder, and if its found in any file, then provide a list of all the files that number was found in so we can pull those files out and investigate further.
so before i go down the rabbit hole of trying all sorts of things.. what should i start with? methods to consider and use?
What's most efficient for such a search? im not super concerned with speed now, but if i can script it so its quick now and later when there is a years worth of files to look thru that would be great.
Any guidance would be great on where or what i should consider to start with. Keeping in mind that i dont have to do anything else with the files, just need to find any files that contain the string provided.