Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Parse data in comment field Post Reply Post New Topic
Author Message
pelli
Newbie
Newbie
Avatar

Joined: 02 Apr 2013
Location: United States
Online Status: Offline
Posts: 2
Quote pelli Replybullet Topic: Parse data in comment field
    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?


Edited by pelli - 02 Apr 2013 at 10:16am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
 
IP IP Logged
pelli
Newbie
Newbie
Avatar

Joined: 02 Apr 2013
Location: United States
Online Status: Offline
Posts: 2
Quote pelli Replybullet Posted: 03 Apr 2013 at 2:52pm
Thanks!  This worked great. 
-Sandy
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.031 seconds.