Need help
Posted: Sat Apr 26, 2008 6:48 pm
Hello,
I am building a weather site and need to gather information from the National Weather Service. Unfortunately, a lot of their information isn't in some of the best formats to pull from. I need to parse information from the text file located at http://www.spc.noaa.gov/products/outloo ... 262000.txt
I need help parsing a file... Specifically, I need the 8 digit numbers, which correspond into lat/long pairs so that I can draw a line across a map. Is there an easy way to parse this text file, gather the 8 digit codes as well as the heading before it?
Realistically, I would like to parse the text file (perhaps into an array), gather the information I need and then store it into a database. My thinking is if I can write a search for each specific section in the text file, I could kick off several instances of the search and have them combined into the database.
I am using PHP and hoping that regex may offer a better solution to searching and storing the information I need from the file. I am more interested getting the categorical numbers for the SLGT and TSTM areas than the top areas... Getting something in the following format would be great...
array = [SLGT, 29680224, 30890281, 32990280, 34040203, 34470120, ...,. ...]
array = [TSTM, 30918077, 30308242, 30248345, 29798491, 29218483, ..., ...]
So.. pretty complicated and way above my skill level.. Can anyone help? Thanks!
I am building a weather site and need to gather information from the National Weather Service. Unfortunately, a lot of their information isn't in some of the best formats to pull from. I need to parse information from the text file located at http://www.spc.noaa.gov/products/outloo ... 262000.txt
I need help parsing a file... Specifically, I need the 8 digit numbers, which correspond into lat/long pairs so that I can draw a line across a map. Is there an easy way to parse this text file, gather the 8 digit codes as well as the heading before it?
Realistically, I would like to parse the text file (perhaps into an array), gather the information I need and then store it into a database. My thinking is if I can write a search for each specific section in the text file, I could kick off several instances of the search and have them combined into the database.
I am using PHP and hoping that regex may offer a better solution to searching and storing the information I need from the file. I am more interested getting the categorical numbers for the SLGT and TSTM areas than the top areas... Getting something in the following format would be great...
array = [SLGT, 29680224, 30890281, 32990280, 34040203, 34470120, ...,. ...]
array = [TSTM, 30918077, 30308242, 30248345, 29798491, 29218483, ..., ...]
So.. pretty complicated and way above my skill level.. Can anyone help? Thanks!