troubleshooting Question

Check for files then combine .txt files

Avatar of movieprodw
movieprodw asked on
PHP
6 Comments2 Solutions157 ViewsLast Modified:
Hello,

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,...
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros