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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to grab part of string from 4th line in field

Status
Not open for further replies.

andreadd

MIS
Jan 15, 2008
67
SQL 2008 R2 / GoldMine Premium

i am currently tasked with exporting email correspndence from GoldMine. Goldmine does this wacky thing and stores email as an image that SQL sees as binary. so I have a SQL view that I am attaching my report to that casts the email into varchar(max). in crystal with no text interpretation i can see that the 4th line of every single email shows the recipients name and email address

Date: Tue, 23 Feb 2010 09:46:17 -0500
From: andreadd <andreadd@myemail.com>
Subject: Cargo LP Meeting
To: Joe Schmoe <schmoe@theiremail.com>

above is the first 4 lines of every email. so I need a formula to grab just schmoe@theiremail.com

from what I have seen the line breaks are actual chr(10)

does anyone have any idea of how to do this?

TIA for the help - I REALLY appreciate it
 
Try this:

stringvar array x := split({table.field},"<");
stringvar y := ubound(x);
if len(y)>1 then
left(y,len(y)-1)

-LB
 
crystal is not enjoying ubound(x); it says a string is needed in its place. I am completely unfamiliar with ubound so I dont know what to give it instead.
 
Sorry, that should be:

stringvar array x := split({table.field},"<");
stringvar y := x[ubound(x)];
if len(y)>1 then
left(y,len(y)-1)

ubound() returns the ordinal number of the last element in an array.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top