Link to home
Start Free TrialLog in
Avatar of Brijeshk9
Brijeshk9Flag for India

asked on

Tool to export text /XML file to mysql

Can anyone please confirm about the tool which we can use to export text file into database like mysql . I need freeware on it. because I want to export the Awstats report into the database which will allow to use non Awstats tool to generate other report such as trending, data comparison/usage matrices and etc..?
Also confirm if Awstats provide such kind of solution..?
ASKER CERTIFIED SOLUTION
Avatar of Michael Worsham
Michael Worsham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you can get the data in XML format, you can create sql scripts from it using XSLT.

XSLT is a standard language (based on XML) that can transform XML into any other text format. It is often used to write html pages from the xml data, but can also be used like this to create sql.

There are a lot of XSLT tools out there. just Google "XSLT tool"
Avatar of Brijeshk9

ASKER

Hamm, I have made the required changes(set both parameters suggested by you) in conf file and now report is coming in XML format but file name is coming with ext: txt .while data under the file is coming in XML&? And now file size for new file created with xml data and ext as text is bigger than the previous text file have data and ext in text  format.
Dont you think it will decrease the Awstats performance for xml data..?  And I found xhtml pages are having smaller size then html but these pages can be opened in browser having higher version..!
Please suggest like which one (XML with xhtml or text with html) is better for Awstats process & performance,because performance with more features (as we get from SEO based tool) is major concern for me.
Is it possible with Awstats to directly store the report in database..? if yes then which is better one as I am looking for freeware on it, also confirm if I need to install anything  extra to get my data in XML..?      
I will look for xslt but can we export text file directly into databse..?
Please provide you valuable inputs for all my questions/doubt given above....!
Thanks...!!      
the awstats  performance does not degrade for XML o/p..  Further its better to get the o/p in XML and use a SP to throw it into MySQL...
and yes the db an directly import text/csv/xml files... if you are going to manually export, try out phpmyadmin to do it for you...it has a import feature...which you can use for the same..
Ok, I have attached one sample text file which I need to export automatically into mysql..?an you please suggest on it. Like if I can export the same file automatically into db and can fetch from db to check for website trend and other detail for particular month  and etc on web or by any other third party tool...?
awstats052009.mywebsite.txt
well brijesh, you can write a  script in any language  (PHP, Perl, etc. ) to parse this and put this in a MySQL DB.  

For interpretive analysis, you can write another tool...however why don't you use awstats itself? Its probably the best too in this category I have seen till date...If you don't use it, then you are better off using the server logs directly for analysis...
I will really appreciate if you can provide me the solution/document(script) on it&?
 For more detail you can check the attached report file in my previous question(may have size till 200-300 MB),
Also confirm if data in attached file is in uniform format for any database, if not is there any way to get the data in uniform format.
To get more detail on it I have attached the Awstats.pl/and conf file with other required files in Awstats process.(all are example file  having ext:txt)

awredir.pl.txt
awstats.model.conf.txt
awstats.mywebsite.conf.txt
awstats.pl.zip
Not sure if I understand this thread correctly, but what I get from skimming over the comments is that you have awstats, you have an option to get XML from awstats, but you don't want to use that option and instead would like to use the plain logfiles and use an extra tool (yet to be build) to create XML from the stats? Why do you want to do extra work if it is already there or am I missing something crucial here?

I'd like to help, but then I also like to know why you choose to recreate something that's already there, I'm sure there's an obvious reason I'm missing. Can you elaborate please?
No let me try to more explicit on it. I am getting the report file in XML format (file attached).then I need to insert it into database&.? So that further I can fetch the required data from database&?
Now please help to insert these xml files into database..?
Also confirm if I can directly insert data(that XML report) into DB: like mysql and then can fetch it easily from DB...?
For example I have attached a small report from Awstats in xml format..!
awstats052009.mywebsite.txt
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks .let me try it...
Sorry I do not have good knowledge on Mysql/XML/Perl. Let me check with my DBA if he can help me in it. Will update you accordingly&&Thanks..!

Ok. That knowledge is indeed quite handy if you want to deal with xml+mysql ;-). If you need professional hands-on services, let me know and perhaps I can arrange something.
Thanks, Let me try first with my DBA ,if you can share/explore anything more on it, will be a great help for me/my DBA...!
stiil waiting for responce from my DBA, will update in next 2 -3 days
take your time, I'll be around :)
abel , I am stuck because of no support from DBA end, now can you pls tell me how to proceed on it.. for more detail you can check the attached report I posted in my comment on 28th May 09.
(file: awstats052009.mywebsite.txt)
now i need to insert that file into db..?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for all the information, I have already discussed with my client for some other better tool.
But Client has decided not to go for any other tool and not interested to purchase anything else, so this is the big problem for me.
Now let me clear the current requirement, I checked the report file which is showing data in very complex format.
Client want to put this all data in database(using free tools) so that he can use that database to check for the website trends like hits, total visits ,unique visitor, bandwidth utilization of particular month/date. Which can be checked by any third party tool or by running any query in DB to see the record in meaningful format.
Please clear some of my doubts..
Ok Awstats cant put data directly into db, but can Awstats take the data from DB directly, please share the evidence if any as I need to give the same to client&?
Is it possible to put some of records from this report into db (m not sure because table is very complex), if yes pls. suggest the better option for the required records lie: hits, bandwidth utilization per, particular URL /keyword hits per day/month/year..?
Any better way to understand the data in report, because it is in complex form..?
Also confirm if we have any better option free/paid.?
Will it be better if we take help from dev resource to write a program to simplify the data and then we can insert it into db, he will also create application (web) to view that data in meaningful format-this we need for long term process, like we can get the record for last 2- years..?
Kindly share some the evidences which I can share with my client, because now client is asking for Timeline on it, which is not possible for me now..?

Have a look at this site: http://www.nltechno.com/awstats/awstats.pl?config=destailleur.fr, it shows the awstats output, with all the information you want.

Now, it looks as if your client is asking to do that all again: write the awstats data that was collected and interpreted by awstats to a database and then read it back and show it.

You ask for a free tool. Awstats is a free tool and does everything you ask and more. It uses its own format, it doesn't need to get data from a database. However, all logfiles are saved in a typical "logfile style", i.e., in a file system as files. Putting this data inside a database and writing a program to get it out again will be the same as saying "I want to go from A to B by train, but I don't want to use a train, please create a train for me". Of course that's possible, but is that really what your client wants?

If so, just fool your client: place the data files as file-blobs in the database, create a little wrapper tool that gets the files out (places them in a directory) and that runs awstats. It would be a waste of your effort, but you achieve three things: 1. the data is in the database (but you can't do much with it, it is in blog-format), 2. the data is retrievable and can be interpreted by a free tool: awstats. 3. your client is happy (until he finds out).

Never forget that interpreting statistics and writing your own visual tool for it is very time consuming (think years, not months). The free tool is already in your possession (awstats), why use another free tool (there isn't any that can use awstats files, but you may find another free statistics tool) to do the same task?

-- Abel --
Thanks Abel ,I agree with All you comments given above.
As I was doing research on it since last 15-20 days, so will it be the right time to tell my client that DB solution is not feasible with Awstats..? and if yes- can you pls. share some of the evidences/proven artifacts , so that I can share with client.
I think you can better understand my query over here, so pls. help me to put the evidences in front of client.
Quick response will be really appreciated..!!
Thanks for the Help.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks abel,let me discuss with my clinet, will let you know..!!
I have confirmed with client and now we are looking for solution like freeware only. thats the main reason behind choosing Awstats.
Now he is looking for any better solution/suggestion to use log parser tool provided by Microsoft as third party tool for reporting inserting logs reports to DB
Here exactly we are looking for exact number of hits (internal /External) like Nimbus/Keynotes provide count for internal hits.
Thanks for all your support and looking for value added solution/suggestions on it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for sharing your valuable suggestions..!
@Brijesk, thanks for the compliment and that you consider my comments valuable. I'd kindly request you have a look here for in the future if you continue asking and grading questions through EE: https://www.experts-exchange.com/help.jsp?hi=403