I have a text file in the following format:
HEADER1
HEADER2
COL1 COL2 COL3 COL4 COL5
With data in each column. What I'd like to do is extract, for example, all data in COL2 and COL4...and write those columns to another file. I also need to ignore the headers that appear before the data...
That might be the problem. I need all lat/lon values to remain in tact, even if they're the same. That way when they're passed to another function that creates the shapefiles (for use in ArcGIS), it can pair the correct latitudes with the correct longitudes.
I can work on that though through...
Thanks much, guys! That really helps. I seem to be losing the last longitude value in both methods, but that may be a consequence of my previous code. I'll have to look over things in more detail later. But it definitely gets me further than I was before.
Thanks so much!
The following script reads a file called warning.txt and extracts a string of latitude and longitude values from the file. The format of this string is: LAT1 LON1 LAT2 LON2 LAT3 LON3 up to a maximum of 20 LAT/LON pairs.
I would like to split the string and store each latitude in its own array...
I was thinking perhaps I could use a loop to store each value in an array, and then access the values by element. But I'd still need some help getting the right pattern.
It's been 2 years since I've done any work with regex in Perl so I'm hoping someone can offer a suggestion. I'd like to save all values in a text file (that's stored in array) between two keywords: "LON" and "TIME", into variables. The problem is I'd like to save each value to its own variable...
Thanks! I actually just did that, although a little differently but the same concept. In the one script I used $location = $_GET['foo'] and in the other script I put "script.php?foo=.'$location.'";
I appreciate it!
The hosting service I am using does not permit the use of registering globals. But I need to pass a variable with a constant value to other scripts that are called.
I've tried:
<?php
session_start();
$location = $_GET['location'] // Passed in from a webform.
session_register("location")...
Well, it turns out that it was indeed the host. The site claimed they allowed fopen but it turns out last week they decided to disable it for outgoing connections from their server.
I ended up getting it to work fine when I set it up locally.
Thanks very much for your help! Hopefully they...
Well, the problem still exists even if I use http to access the file I need (the files are stored both on FTP and HTTP). I also verified fopen is set to true.
Thanks for your reply. Unfortunately it isn't set to false. Someone else running a similar script is also having problems which is making me think it might be some sort of issue with the file server I'm accessing. Hmmm...
All of a sudden I'm getting the following errors when trying to execute a script:
Warning: fopen() [function.fopen]: connect() failed: Permission denied in /home/www/jmg498.freehostia.com/radar/crrdr.php on line 51
Warning...
Nevermind, figured it out!
<?php
if($temp > "271.16") {
$ratio = 12+2*(271.16-$temp);
}
$ratio = 12+(271.16-$temp);
print "The snow to liquid ratio is $ratio";
?>
This thread can be deleted. Thanks!
I'm not quite used to the syntax of performing arithmetic operations on variables in PHP. Below is my code. I think it's pretty obvious what I'm trying to do based on the code, but I just don't know how to format it correctly in PHP.
Any help is GREATLY appreciated! :) $temp is a variable...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.