I have a server where a company uploads multiple .txt files of inventory.
The problem is that I have to run a script for each file, and they are constantly adding them.
They are all the exact csv format.
Is it possible to check the folder for .txt files, and combine them into one file? I am concerned about the first line of the files as they are the column names.
Here is what I am using to load them one by one if this helps.
$loadsql = 'LOAD DATA INFILE "../../../var/www/vhosts/domain.com/web_users/company/inventory_1.txt" INTO TABLE data_processing
FIELDS TERMINATED BY "\",\"" LINES TERMINATED BY "\"\n\"" IGNORE 1 LINES (column_1,...