Forum Moderators: coopster

Message Too Old, No Replies

Adding a CSV file to my site

convert csv file in to html via tables

         

thesnoopy

2:26 pm on May 11, 2005 (gmt 0)

10+ Year Member



Hi Need some help I have a csv file that updates every 3 mins with 12 lines of data. data as follows

'Fight Title
'Boxer 1 Name
'Boxer 2 Name
'Round Number
'Boxer 1 Head Shots Landed
'Boxer 1 Body Shots Landed
'Boxer 1 Jabs Landed
'Boxer 1 Missed punches
'Boxer 1 Total Landed
'Boxer 1 Total Thrown
'Boxer 1 Unofficial Score
'Boxer 2 Head Shots Landed
'Boxer 2 Body Shots Landed
'Boxer 2 Jabs Landed
'Boxer 2 Missed punches
'Boxer 2 Total Landed
'Boxer 2 Total Thrown
'Boxer 2 Unofficial Score

the 12 lines of data are each round

but what i then need to do is get this information to the site so that it is visable to web users in a easy to read format.

I can supply you with a sample csv file if required.

Many thank

Frank_Rizzo

2:32 pm on May 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What process is generating that file? Why not get it to generate a html table instead?

If you have no control of that then you will need perl or php to read the csv and convert the data to html.

But is this to be a historic record or a live snapshot?

If histori then you'll need to store it in a database.

thesnoopy

2:54 pm on May 11, 2005 (gmt 0)

10+ Year Member



Thanks for the quick reply it will be live and then stored as archive it can be in what ever format is easiest to do.

this is a sample of what i would like ot to look like

I have no control of the csv file it will just be uploaded to my server every 3 mins with all the latest data on it. and will always be called boxstat.csv

hope this helps

[edited by: jatar_k at 3:58 pm (utc) on May 11, 2005]
[edit reason] no urls thanks [/edit]

jusdrum

4:05 pm on May 11, 2005 (gmt 0)

10+ Year Member



Check out the fgetcsv() function: [us3.php.net...]

thesnoopy

4:44 pm on May 11, 2005 (gmt 0)

10+ Year Member



many thank for your reply but ive tried all them and none seem to work.

my csv looks like this

HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,1,12,2,2,34,14,48,9,14,3,12,53,17,70,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,2,19,5,6,43,24,67,9,13,8,10,81,21,102,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,3,17,3,7,44,20,64,10,14,13,9,74,27,101,9
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,4,13,2,2,43,15,58,9,19,3,16,55,22,77,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,5,21,2,11,54,23,77,10,16,6,12,62,22,84,9
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,6,10,1,1,43,11,54,9,24,5,16,59,29,88,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,7,18,2,6,59,20,79,9,21,11,11,49,32,81,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,8,17,1,3,37,18,55,9,26,5,16,41,31,72,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,9,22,2,5,46,24,70,10,9,3,5,60,12,72,9
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,10,11,0,2,39,11,50,9,22,7,15,54,29,83,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,11,15,2,2,39,17,56,9,22,5,10,57,27,84,10
HARRISON V MEDINA,SCOTT HARRISON,MANUEL MEDINA,12,18,0,3,53,18,71,9,34,10,18,59,44,103,10

jatar_k

5:31 pm on May 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld thesnoopy

maybe try this thread
Basics of extracting data from csv files [webmasterworld.com]