
PRO
dbeard
USA
Asked
— Edited

I have been able to get and save the attached file to my hard drive. I can read it but I can not figure out how to pull just the data I want. In this case it is a stock quote for VZ. I want to just pull out the symbol and stock price.
I would appreciate any examples of how to accomplish that.
Thank You
if you can add the ARC and ezb as a reference to your project in Delphi, then it will work I suspect. I haven't used Delphi since around 1998 or so...
I assure you c# is incredibly powerful, very popular and really easy to use. Think you will like it
WBS....I have been trying not to bother you, but I have a problem that I cnat seem to overcome. I have been using the HTMLSCRUB program to look through data on this website www2.jpl.nasa.gov/calendar/#1509. my goal is to search by date and then output information for the current date. I have successfully done this with other sites using versions of your code. When I do it on this site, I can print out the line of data, when it finds the string I am looking for. But the moment I try to use the substring command to go through and pick out the information I want I get the error, Input string was not in the correct format. Any thoughts about what I am doing wrong. thanks.
No problem. You're not bothering me at all. Could you put one of the input strings which is causing the error message in your next post? That's one error I've never gotten for the SubString instruction.
I really need to turn loose of the code I have for the update, I just can't seem to stop tinkering with it.
This code is not complete. right now just playing with it, but if you run it you will get the error, if you could tell me what i'm doing wrong that would be awesome.
$PrintDebugOn =False $Silence =0 $SendSpeechToPC =1 $SendSpeechToRobot =2 $skipit=0 $stockstatus=0 $foundit=-1 $point=0 $SendSpeechTo =$SendSpeechToPC #Default. Change as needed'
if ($month=9) $mymonth="Sep" endif
$todaydate = $mymonth+" "+$day $thedate = $todaydate
Enter the full path and name of the files to be used
$VZFile ="C:\users\public\documents\calendar\asteroid.txt" $ModVZFile ="C:\users\public\documents\calendar\Modasteroid.txt"
The full path and name of the HTML scrubber program.
$ScrubProg ="C:\users\public\documents\calendar\HTMLScrub.exe" $IndexesToGet ="<li>" #Note: COMP is NASDAQ
$IndexesToGet ="DJIA,COMP,NYA" #Note: COMP is NASDAQ
FileDelete($VZFile) #Clears the file and prevents adding to it needlessly FileWrite($VZFile,HTTPGet("http://www2.jpl.nasa.gov/calendar/#1509" )) FileReadClose($ModVZFile) Sleep(2000) Exec($Scrubprog) #Modifies $VZFile.txt and creates $VZModFile.txt Sleep(5000) #May need to be adjusted depending on file size. FileReadReset($ModVZFile)
$TheIndexesToGet =$IndexesToGet+"," #So we don't mess up the original
$Prefix is used to get the correct line with the index name.
This needed because the index name is used in many lines.
$Prefix ="<td class=symb-col><a href= investing index " repeatwhile($TheIndexesToGet !="") $IndexPhrase =$Prefix+Split($TheIndexesToGet,",",0) #First index if ($PrintDebugOn) Print($IndexPhrase) endif FileReadReset($ModVZFile) #Always start from the beginning $ExitLoop =False repeatwhile(FileReadEnd($ModVZFile)=0 AND $ExitLoop =False) $TheText =FileReadLine($ModVZFile)
endrepeatwhile endrepeatwhile
$list=0
sort test
repeatuntil($sortcounter = $arraycounter)
print ($sortcounter+" "+$arraycounter)
if ($objectdist[$thenumber]< $objectdist[$sortcounter+1])
$thenumber=$thenumber
ELSE
$thenumber=$sortcounter+1
endif
$sortcounter=$sortcounter+1
endrepeatuntil
say ("There are "+$arraycounter+" objects approaching Earth today")
say("The object approaching closest is "+$objectname[$thenumber]+" and it will be within "+$objectdist[$thenumber]+" myles of Earth")
sleep (5000) filereadclose("c:\users\public\documents\calendar\ModAsteroid.txt") #halt
Ok. I found out what it is. At first I thought it might be the ampersand or the colon, but after eliminating those it still did it. I had to use a process of binary elimination to finally get the string down to what it actually was. Turns out it appears to be another bug. Anytime there is a capital "E" in a string, it seems to be interpreted as an Exponent reference IF it is followed by a number.
So E2, E0, E1234, whatever, will cause the same error. This will be somewhat more difficult to eliminate. I hate to have the scrub process have to take out all occurances of E0, E1, E2 ... E9. That will take a lot of extra time. I could have a space inserted any place there is a capital E, but that would cause problems with actual words beginning with a capital E as well. Probably I'll have to do a special search for the E-Number combination and deal with that as opposed to the simple search and replace the program does now. Hopefully it will still be nearly as fast, even on a large file. I think I'll allow for an update to a line in the ini file to tell the program what characters to eliminate or replace. That way you can add to it as needed rather than my having to send a revised executable every time. Of course, the problem with that is that it would not have helped in this particular case. Maybe I can figure a way to include this sort of problem as well. We'll see.
But before I can send a replacement executable file to replace the one you have, I need to know if the ini file you are using has the following lines in it:
[FileLimits] MaxFileSize=100000
The number may be different but that doesn't matter. That way I'll know which of the earlier versions of the program I need to revise to solve this problem.
Also, where this site is concerned, are you wanting to be able to search the whole site or just that part that deals with the current month and year? If just the current month or so, the scrub process could be made much faster by dealing with considerably less of the code from the webpage.
Glad to know it wasn't something I did wrong. I looked for 3 days until I gave up.
Yes, I have the file limits set 100000. Also in the INI is the path settings.
I am not sure it is worth it to do that extra work. Is there really anyone else that is ever going to run into this problem.
What if you replaced E with EE would that fix the problem of being considered an exponent? That could be edited back out with the script to change it back to E if needed. But again, not sure worth the effort.
I am just looking at the current month and year.
I'm afraid EE won't work. Even if the E is preceded by other letters (or symbols), the same problem occurs. So EE0 still causes the error, as will ASEFGHeE01.
That said, I believe I have found an answer that will not require extra programming. Changing E to E' does not seem to have any effect on the pronouncing/saying of the words, so it looks like there is an easy solution after all.
Here is an update to the version of program you have. I tried it with your script and the directories you used before (C:\Users\Public\Documents\calendar) so it should be ready to go. Seems to locate the date just fine now. Let me know if you have any problems with it.
BTW, when the script crashes, it can leave files open. That can make it impossible to do things like save a modified version of the Modasteroid.txt file if you do any modifications by hand for testing. Here is a short script for closing the files used:
You may want to copy and paste it into a script called "CloseFiles" or some such. That way you can close the main files involved, by running the script, should there be a problem. I ran into that issue several times while tracking down this problem.
HTMLScrub.zip