|
Posted by elyob on 11/11/18 11:50
"Toby Inkster" <usenet200606@tobyinkster.co.uk> wrote in message
news:usb7m3-v6l.ln1@ophelia.g5n.co.uk...
> elyob wrote:
>
>> I want to read the BT hotspots xls to a readable format...
>> http://www.btopenzone.com/downloads/BT_Openzone_Hotspot_List.xls
>
> Use PHP's curl[1] stuff to download and save the file, use system()[2] to
> pass it through xls2csv[3], read the result into a PHP array using
> file()[4] and then explode()[5] each element of the array on comma.
>
> ____
> 1. http://uk2.php.net/manual/en/ref.curl.php
> 2. http://uk2.php.net/manual/en/function.system.php
> 3. http://www.45.free.net/~vitus/software/catdoc/
> 4. http://uk2.php.net/manual/en/function.file.php
> 5. http://uk2.php.net/manual/en/function.explode.php
>
Thanks all for the replies. I've been busy just testing the work, and
manually converting to csv to start with and uploading the file via
phpmyadmin.
However, am getting an error ... Invalid field count in CSV input on line
748
I'm looking at the file, and cannot see any problems with this middle line
....
Oulu airport,Airport,Oulu airport,,Oulunsalo,90460,Finland,Sonera Homerun
Hotel Rantasipi Eden,Hotel,Paratiisikatu
2,,Paratiisikatu,37120,Finland,Sonera Homerun
Stadshotellet Jakobstad,Hotel,Kanalesplanaden
13,,Pietarsaari,68600,Finland,Sonera Homerun
I've just removed that single line, and the file now uploads fine. However,
it's eight fields etc, and all looks fine.
<scratches head>
[Back to original message]
|