This is a discussion on Incoming data into array? within the PHP Language forums, part of the PHP Programming Forums category; Hi, I'm opening a remote file on a regular basis, the data is in the following format and has ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, I'm opening a remote file on a regular basis, the data is in the
following format and has a line feed of "0D 0A". The spaces are 20 in hex mode. 2006-07-26 22:00:03.000000 4.370996 51.656616 2006-07-26 22:00:03.000000 2.599964 49.286836 2006-07-26 22:00:03.000000 0.876824 48.418013 2006-07-26 22:00:04.000000 1.543656 50.926529 2006-07-26 22:00:04.000000 1.070219 48.759254 Firstly, this incoming data is oldest first and is continually updating. However it only shows the previous hours data. My main aim is to take this data and split it into an array. Currently I'm using file_get_contents(), and am just wondering what the best method to get this into a workable format? Thanks |
|
|||
|
elyob wrote: > Hi, I'm opening a remote file on a regular basis, the data is in the > following format and has a line feed of "0D 0A". The spaces are 20 in hex > mode. > > 2006-07-26 22:00:03.000000 4.370996 51.656616 > 2006-07-26 22:00:03.000000 2.599964 49.286836 > 2006-07-26 22:00:03.000000 0.876824 48.418013 > 2006-07-26 22:00:04.000000 1.543656 50.926529 > 2006-07-26 22:00:04.000000 1.070219 48.759254 > > Firstly, this incoming data is oldest first and is continually updating. > However it only shows the previous hours data. My main aim is to take this > data and split it into an array. Currently I'm using file_get_contents(), > and am just wondering what the best method to get this into a workable > format? > > Thanks http://fi.php.net/file |
|
|||
|
"Chung Leong" <chernyshevsky@hotmail.com> wrote in message news:1153962861.032797.37480@m73g2000cwd.googlegro ups.com... > > elyob wrote: >> Hi, I'm opening a remote file on a regular basis, the data is in the >> following format and has a line feed of "0D 0A". The spaces are 20 in hex >> mode. >> >> 2006-07-26 22:00:03.000000 4.370996 51.656616 >> 2006-07-26 22:00:03.000000 2.599964 49.286836 >> 2006-07-26 22:00:03.000000 0.876824 48.418013 >> 2006-07-26 22:00:04.000000 1.543656 50.926529 >> 2006-07-26 22:00:04.000000 1.070219 48.759254 >> >> Firstly, this incoming data is oldest first and is continually updating. >> However it only shows the previous hours data. My main aim is to take >> this >> data and split it into an array. Currently I'm using file_get_contents(), >> and am just wondering what the best method to get this into a workable >> format? >> >> Thanks > > http://fi.php.net/file > I always like short answers, thanks! |
|
|||
|
"elyob" <newsprofile@gmail.com> wrote:
> Hi, I'm opening a remote file on a regular basis, the data is in the > following format and has a line feed of "0D 0A". The spaces are 20 in hex > mode. > > 2006-07-26 22:00:03.000000 4.370996 51.656616 > 2006-07-26 22:00:03.000000 2.599964 49.286836 > 2006-07-26 22:00:03.000000 0.876824 48.418013 > 2006-07-26 22:00:04.000000 1.543656 50.926529 > 2006-07-26 22:00:04.000000 1.070219 48.759254 > > Firstly, this incoming data is oldest first and is continually updating. > However it only shows the previous hours data. My main aim is to take this > data and split it into an array. Currently I'm using file_get_contents(), > and am just wondering what the best method to get this into a workable > format? Are there no spaces within fields? Just use fgetcsv() with ' ' as the delimiter. miguel -- Photos from 40 countries on 5 continents: http://travel.u.nu Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco Airports of the world: http://airport.u.nu |