I have several data sources ranging from business databases to email lists. All of these data sources are in .csv format. For example, I have a USA business database that includes all businesses in the USA. This data is broken up into 50 individual .csv files (one .csv file per state).
I need to be able to extract and create individual .csv files based on certain filters. For example, I want to create individual .csv files for attorneys based on each zip code. I need a script that can query all the data in a directory (for example the directory that has all the .csv files) and it will output this data into multiple (in most cases thousands) of individual files.
I need to be able to select the filters and the file output needs to be named according to the content of the file.
For example, the attached data sample is a small exert from the state of Alaska. In the same directory, I have 49 other .csv files in the same format. I want to be able to select a couple criteria and run a script to create individual .csv files. For example, if I wanted file creation for Attorneys with SIC code of 811103 separated by zip codes, the script would create a unique .csv file for each zip code for attorneys. If there were 500 records for attorneys in zip code 99501 the name of the output file would be [login to view URL] and the next output file might be [login to view URL] etc. Running the query on the entire directory containing the .csv files would create tens of thousands of individual .csv files that would be named according to the contents of that file.
This script needs to be able to be loaded locally on the computer with the data. The script needs to be able to have different filters selected to determine the file output.