Hi
I have tried to find a solution to my problem, but can´t find the solution I am looking for, so hopefully, someone in here can help me.
I have millions of .csv files that I need to merge by a wildcards match on the file name, the merged .csv file needs to be divided by some of the filenames and only contain one header.
Let´s say I have the following files.
0006041651_00017771_20190820.csv
0006041651_00017771_20190819.csv
0006041651_00017771_20190818.csv
0006041651_00017771_20190817.csv
0006041651_00017771_20190816.csv
0006041651_00013333_20190820.csv
0006041651_00013333_20190819.csv
0006041651_00013333_20190818.csv
0006041651_00013333_20190817.csv
0006041651_00013333_20190816.csv
What I need. Is something that can match some of the filename 00017771 merge it with all the other files in the folder that contains 00017771 and only keep one header for all the merged data.
When done with 00017771 it should move on to the next 00013333 and so on.
I think I need to set something that knows what I am looking for in the file name, is the second _ in the filename, and ends with the third _
xxxxxxxxxxx_00017771_xxxxxxxx.csv
Hope this is not too confusing