Print Page | Close Window

Parse data in comment field

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19358
Printed Date: 26 May 2024 at 3:51am


Topic: Parse data in comment field
Posted By: pelli
Subject: Parse data in comment field
Date Posted: 02 Apr 2013 at 10:16am
New to writing code, but not to Crystal Functions.
 
I need to parse data in a comments field to pull anything after  a specified word; i.e Name, address, city, state; Parcel xxxxxxxx.  It will be in the same format, the word "parcel" after a semi colon, but the end length will vary.  I need to parse everything after the word "parcel". Any suggestions?



Replies:
Posted By: hilfy
Date Posted: 03 Apr 2013 at 8:00am
You could do something like this:
 
StringVar parcel := '';
NumberVar atParcel;
 
at := InStr({table.comments}, '; Parcel');
if at > 0 then
  parcel := lTrim(Mid({table.comments}, at + 7, length({table.comments}));
parcel
 
This will give you everything after the word "Parcel" if it is preceded by "; ".  So, it should filter out any situations where the word Parcel is included in the address etc.
 
-Dell
 


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: pelli
Date Posted: 03 Apr 2013 at 2:52pm
Thanks!  This worked great. 
-Sandy



Print Page | Close Window