473,662 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Project Design Advice

Hello all. Thanks for reading and for any advice...

Ok, I have a linux webserver with php/mysql/apache.
Next, there are csv (comma separated values) log files on a user's
WINDOWS machine
(and not on the webserver)
in a local directory of theirs like so:

d:\reports\log_ data2004_`\log_ data_jan\log_fi le_jan.txt
d:\reports\log_ data2004_2\log_ data_feb\log_fi le_feb.txt
etc...
(The \reports\log_da ta\ has several subordinate folders with txt log
files in each...

Now, I need to get these csv text files from the user's windows machine
and onto the linux server and into mysql...
I am able to manually get a single log file into mysql using LOAD DATA
via the command line, however, I need a good way to load all log files
(from their subordinate folders on the windows box) into the database.

I cannot get (and don't think it works anyways) LOAD DATA to work from
a php script.

SHould I have them upload the individual log files ontoe linux box
and process them there?
And if so, what would be the best way to have php look in a directory
(once the files are on the linux box) and load these files into mysql ?

Any ideas?

Thanks very much!

Jul 17 '05 #1
1 1318
john wrote:
Hello all. Thanks for reading and for any advice...

Ok, I have a linux webserver with php/mysql/apache.
Next, there are csv (comma separated values) log files on a user's
WINDOWS machine
(and not on the webserver)
in a local directory of theirs like so:

d:\reports\log_ data2004_`\log_ data_jan\log_fi le_jan.txt
d:\reports\log_ data2004_2\log_ data_feb\log_fi le_feb.txt
etc...
(The \reports\log_da ta\ has several subordinate folders with txt log
files in each...

Now, I need to get these csv text files from the user's windows machine
and onto the linux server and into mysql...
I am able to manually get a single log file into mysql using LOAD DATA
via the command line, however, I need a good way to load all log files
(from their subordinate folders on the windows box) into the database.

I cannot get (and don't think it works anyways) LOAD DATA to work from
a php script.

SHould I have them upload the individual log files ontoe linux box
and process them there?
And if so, what would be the best way to have php look in a directory
(once the files are on the linux box) and load these files into mysql ?

Any ideas?

Thanks very much!

John,

If you can easily generate a list of the files you wish to load
(with full pathnames) and copy it to your Linux server the
easiest way to solve your problem is to use a text editor the
file to a set of LOAD DATA commands and then execute the file.

For example assume you are using the vi editor in Linux:

Step 1 create a file containing 1 file name to load per line:
d:\reports\log_ data2004_`\log_ data_jan\log_fi le_jan.txt
d:\reports\log_ data2004_2\log_ data_feb\log_fi le_feb.txt

Step 2 edit the file to convert each line into a LOAD DATA command:
:%s/.*/LOAD DATA INFILE "&" INTO TABLE my_table FIELDS
TERMINATED BY "," ENCLOSED BY "\\"";\

Step 3 save the edited file and execute it. (Assume you called
it loadfiles)

.. ./loadfiles

(The first dot says execute it even though it isn't defined as
being executable. The ./ says it is in the current directory.)

Step 4 QA the data to be sure that your load worked properly.
HTH

Jerry
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
8713
by: Michael Strorm | last post by:
Hi, I'm in the middle of "teaching" myself C++. Having skimmed some of the "Teach Yourself C++ in 21 Days" book, I got a feel for the language, at least. Then I bought "The C++ Programming Language" because it was on offer, and I'd have ended up buying it at some stage anyway. Skimmed some of that, but there's too much detail (for now) and I know I won't take it in if I don't get some practice in actually *writing* programs in C++. I'm...
7
1372
by: Phil Powell | last post by:
I am one of 95 people on a project bid (I do freelance on the side), and the potential buyer wants for each of us to produce a professional L&F mockup based upon an existing site (http://www.mackay.qld.gov.au) for his particular site (http://www.laidley.qld.gov.au) and I am trying to give him what he wants, except that I am running into a snag: Hiermenus. I am unable to (and honestly unwilling to) purchase even the older versions of...
24
1903
by: sundew | last post by:
Hi all, I am developing an open source DHTML project named Wednus Window. http://wednus.com Wednus Window is a DHTML Web-Application Windowing System. It shell websites/web-applications with fully customizable DHTML window objects and users also can change its skin, so it can goes well with an website layouts.
1
3508
by: athos | last post by:
Hi all, Believe you have sound experience in development, however, if we look at the whole Software Development Life Cycle (SDLC) of the project, say, 1. Project Initiation, 2. Gathering Requirements, 3. System Analysis and Design, 4. System Development,
31
3591
by: Bob | last post by:
I have recently joined a healthcare company where I am the solo programmer. I am going to be starting work on a project. The management has asked me to provide an estimate of hours I am going to spend on the project. How do I estimate the number of hours I am going to spend on programming in a project? Thanks for help
23
2372
by: JoeC | last post by:
I am a self taught programmer and I have figured out most syntax but desigining my programs is a challenge. I realize that there are many ways to design a program but what are some good rules to follow for creating a program? I am writing a map game program. I created several objects: board object that is an array of integers each number 0-5 is a kind of terrain, a terrain object that is an array of terrain types and each number of...
6
1627
by: mscertified | last post by:
I'm about to start my first Dot Net Project. It seems fairly simple but then I'm a neophyte. I've just taken a few dot.net courses and have some background in classic ASP. The application is web-based. Basically one set of users fills out various portions of a form, submits the data to another set of users in other locations who then perform various actions (online and offline) and then post the item 'job completed' and send it back to the...
11
2213
by: maybetooparanoid | last post by:
Hello, I am now in the crucial moment I must choose one GUI platform for a new project, and would like to get some advice from experts. Details about my project: - source code is in C++ =GUI should interface the existing code easily, and exchange complex data structures with the core of the application. - not commercial right now, but it might be in the future =I cannot
49
3913
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the isomorphism between filesystem and namespace, doesn't seem very well suited for big projects. However, I might not really understand the Pythonic way. I'm not sure if I have a specific question here, just a general plea for advice. 1) Namespace....
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.