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!

extracting a string 1

Status
Not open for further replies.

izachar

Technical User
Oct 7, 2000
84
CA
I have a log file in a db. One of the columns is a target field that has the URL in it. I need to extract the extention xml from the url so I can count it and get my page views. I tried InStr {InternetLog.target}, ".xml") but it does not take only the xml lines. What do you recommend?
 
If you know the position in the string you can control it using the mid function.

mid (fieldname,starting position,length)

example: the string1 "abc123"

mid (sting1,3,2) will return "c1"

Good luck
 
No I don't know the location. Every time it could be different since it is an xml file with different parameters after it. I can do this with an sql statement in the db using a filter based on a "like" condition but sql in crystal is a little funky.
 
Do you need:

determine its position in the string or
determine its existance in the string?

Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
I need a count on the xml so it is filtering out the lines that have xml in them.
 
Are you trying to count the number of records that have 'xml' somewhere in the {InternetLog.target} field? Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Write a formula that says:

if 'xml' in {InternetLog.target}
then 1
else 0

Put this field on the detail band.
Create subtotals and grand totals of this field as needed. A sum of this field will tell you how many records have xml in that field.
Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top