Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help again...

Status
Not open for further replies.

HITAspect

Technical User
Apr 29, 2005
4
US
I have made some progress but I am stumped, I am still trying to figure out how to only output the information that is within the quotes. I was able to start to output based on the " but am uncertain how to output every character on the same line until it sees the second quote, then insert a new line and loop. Thanks in advance for the help.

proc main
string FName ; Name of file to read.
string FName2 ; Name of file to create.
;string CName
string LineInfo
string LineInfo2

clear
;sdlginput "Capture Name" "Name:" CName
;set capture file CName
;capture on
if sdlginput "File Name" "Name:" FName
sdlginput "Output File Name" "Name:" FName2
if isfile FName ; Make sure file exists.
if fopen 0 Fname READ ; Open input file for read.
if fopen 1 FName2 CREATE TEXT ; Create output file.
while not feof 0 ; Loop while not at end of file.
fread 0 LineInfo 2
if strchr LineInfo '"' ; Check for target text in string.
while not feof 0
fread 0 LineInfo2 2
if LineInfo2'"'

else
fputs 1 LineInfo2
endif
endwhile
usermsg "value `"%s`" " LineInfo
else
usermsg "Target string not found in search string!"
endif
endwhile
fclose 1 ; Close our output file.
else
errormsg "Couldn't open `"%s`" for output." FName2
endif
fclose 0 ; Close the file.
endif
else
errormsg "File doesn't exist."
endif
endif
pause 9 ;pause for terminal completion





;capture off ;end capture

endproc

 
Another question for you, where can I read more about the langauge than in the help file?
 
Regarding the last part of your question, there is not much available about ASPECT. Here is some information I copied from my site that has a couple pointers you might try:

Be sure to browse the SAMPLES directory on your Procomm Plus 4.8 CD for sample scripts, as well as the two tutorial PDF files in the SAMPLES\ASPECT directory. Also be sure to read ASPECT.PDF in the DOCS directory on the CD. This file is a high-level overview of ASPECT that serves as a very good introduction to the language, and also includes many sample scripts toward the end of the document. One final source of sample scripts is the ASPECT help file discussions of the various commands as they include many examples illustrating how the commands are used.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top