Extract data from .txt file
Posted: Mon Dec 15, 2008 9:31 pm
Hello,
I would greatly appreciate help with the following!
I need a PHP function that can extract data from a plain .txt file (separated into rows and columns) into individual variables or arrays.
For reference, see this file: http://www.ndbc.noaa.gov/data/realtime2/41002.txt
For example, assign the data value in row 3 column 4 as $WSPD['4']
Is there any easy way to do this? Ultimately, I'd like to extract the data from files similar to the above and insert it into a MySQL database.
Any help or hints would be greatly appreciated!!!!!
-Dustin
I would greatly appreciate help with the following!
I need a PHP function that can extract data from a plain .txt file (separated into rows and columns) into individual variables or arrays.
For reference, see this file: http://www.ndbc.noaa.gov/data/realtime2/41002.txt
For example, assign the data value in row 3 column 4 as $WSPD['4']
Is there any easy way to do this? Ultimately, I'd like to extract the data from files similar to the above and insert it into a MySQL database.
Any help or hints would be greatly appreciated!!!!!
-Dustin