4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 A little problem with a substitution...
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Fri Feb 08, 2002 5:48 pm (22 years, 2 months ago) Reply with QuoteBack to Top

I,ve a problem related to one script I'm doing. Everything is going well, except for one thing: the result of the cgi script is as follows: (sorry for the size)
Code:

<![color=red]DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>Untitled Document</TITLE>
</HEAD><BODY BGCOLOR="#f5f5dc"
TEXT="black"><PRE><FONT SIZE=3><FONT COLOR=midnightblue><STRONG>  <BR></STRONG><STRONG> ####################################################################################### <BR></STRONG><STRONG>                       EPHEMERIDES DES CORPS DU SYSTEME SOLAIRE   <BR></STRONG><STRONG> ####################################################################################### <BR></STRONG><STRONG>  <BR></STRONG><STRONG>  Planete  1 Mercure <BR></STRONG><STRONG>  Theorie planetaire DE405/LE405 <BR></STRONG><STRONG>  Repere Astrometrique J2000 <BR></STRONG><STRONG>  Centre du repere : geocentre <BR></STRONG><STRONG>  Coordonnees equatoriales (R.A, Dec.) <BR></STRONG><STRONG>  <BR></STRONG><STRONG> ####################################################################################### <BR></STRONG><STRONG>  <BR></STRONG><STRONG>          Date UTC              R.A            Dec.          Distance     V.Mag   Phase   Elong. <BR></STRONG><STRONG>              h  m  s       h  m  s         o  '  "            ua.                  o        o <BR></STRONG><STRONG>  <BR></STRONG></FONT><STRONG>  8  2  2002 16  3  9.00   20  0 44.32778 -17 55 36.2888    0.756110555    0.72  114.60    21.23 <BR></STRONG></FONT><BR>&nbsp;<STRONG><P><IMG WIDTH=100% HEIGHT=3 SRC=/ephem/ephepos/icons/blurulr1.gif><P>&nbsp;<br>&nbsp;&nbsp;&nbsp;<A HREF=/ephem/ephepos/ephepos_datapos.html target=formulaire>&gt; Signification des param&egrave;tres calcul&eacute;s</A><BR>&nbsp;&nbsp;&nbsp;<A HREF=/tmp/datapos/tmp10356.Mercure>&gt; Fichier r&eacute;sultats au format ascii</A></STRONG></PRE><P><IMG align=top WIDTH=100% HEIGHT=3 SRC=/ephem/ephepos/icons/blurulr1.gif><P><b><FONT SIZE=3 COLOR=blue> Si vous d&eacute;sirez utiliser ces donn&eacute;es en vue d'une diffusion publique, veuillez nous consulter au pr&eacute;alable.<BR>&#169
J&eacute;r&ocirc;me Berthier et Pascal Descamps - Institut de M&eacute;canique C&eacute;leste / Bureau des longitudes, 1999.</b></font></BODY></HTML>[/color]


but I just want to appear with
Code:

 
          Date UTC              R.A            Dec.          Distance     V.Mag   Phase   Elong. <BR></STRONG><STRONG>              h  m  s       h  m  s         o  '  "            ua.                  o        o <BR></STRONG><STRONG>  <BR></STRONG></FONT><STRONG>  8  2  2002 16  3  9.00   20  0 44.32778 -17 55 36.2888    0.756110555    0.72  114.60    21.23



How can I do this? Can you help me (please)?

Best regards,

Rui Fernandes
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Gandalf
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 52
Location: Israel

PostPosted: Fri Feb 08, 2002 7:52 pm (22 years, 2 months ago) Reply with QuoteBack to Top

I personally don't know any CGI, but even if I knew, without the actual script I could do very little. Why not put a link to the script code, so that anyone who wants to can go and have a look? (DO NOT post it as a forum post)

________________________________
Everything should be made as simple as possible, but no simpler.
OfflineView User's ProfileFind all posts by GandalfSend Personal MessageICQ Number
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Sat Feb 09, 2002 12:26 am (22 years, 2 months ago) Reply with QuoteBack to Top

for giving you a solution we must know the script as changes will have to be done in that to get correct ans.

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Sat Feb 09, 2002 8:48 am (22 years, 2 months ago) Reply with QuoteBack to Top

Well, the problem is this: the script itself is complicated; but one variable gives the first result ($out). What I was trying to do was to transform that first one into the second - like those simple scripts wich elimimate the html tags, for example.
I've tryed to locate "Date UTC" and get the next line, by using the split command with the <BR> separator. But it didn't work - I'm doing something wrong...

Best regards,

Rui Fernandes
OfflineView User's ProfileFind all posts by keplerSend Personal Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Sat Feb 09, 2002 8:53 am (22 years, 2 months ago) Reply with QuoteBack to Top

Sorry, I've forgot to put the script. Here it is:

$flag=0;
$output="";
$break="<br>";
@lines = split(/"<BR>"/, $out);

foreach $line (@lines)
{
if (($flag >0)&($flag<2))
{
$output=$output.$break.$line;
}
if ($line =~ /"Date UTC"/i )
{
$output=$output.$break.$line;
$flag = $flag + 1;
}

}

best regards,

Rui Fernandes
OfflineView User's ProfileFind all posts by keplerSend Personal Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Sat Feb 09, 2002 2:54 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Problem solved! Very Happy

But thanks anyway.

Rui Fernandes
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.227368 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme