ImportCumulusFile: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
m
version 1.1b
m (1.1a added date delimiter)
m (version 1.1b)
{{AddOnBanner|name=ImportCumulusFile|type=PHP|author=David A Jamieson|contact='DAJ' via the forum|updated=4 Feb 2010|version=1.1a1b}}
 
This is a PHP script designed to run on your webserver and import Cumulus log files into a MySQL database on your server.
*PHP
*MySQL
*A My SQL database, username and password
*a Cumulus Log already uploaded
 
:servername, username, password, database and security key
:these are documented in the file at the top.
 
:There isare athree sixthfurther andvariables seventhto entryconsider whichand may require editing. Look at the text file you are importing. How is each field separated/delimited? How is the date delimited? How is a decimal number shown? In the UK there is nothing else needs changed. If for example your delimiter is a semi-colon and a dash then change the lines $field_delimiter and $date_delimiter accordingly.
:if your decimal separator is a comma this also needs to be changed in the file using the $decimal_separator variable
 
*save the file as ImportCumulusFile.<b>php</b> or whatever name you prefer and upload it to your webserver.
 
*file=xxxxx
::the location on your webserver, relative to this script location, of your Cumulus File
::example file=dayfile.txt or file=../data/Jan10log.txt
 
*table=xxxx
An example URL...
 
:htp://www.myserver.com/ImportCumulusFile.php?type=dayfile&key=letmein&table=Dayfile&file=/data/Jan10log.txt
 
 
=Version Control=
 
*1.1b Added a variable to consider decimal separator
*1.1a Added date delimiter
*1.1 Added the facility to identify the delimiter used on the import file
1,120

edits

Navigation menu