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

splitting memo field? 1

Status
Not open for further replies.

mollie

IS-IT--Management
Jan 6, 2002
27
US
Hi -

I have a memo field that I want to split into various records:

here's how the memo field appears (for records that make sense!)

01/17/05 NN: His plant problems seem to be from urea application. Plants were growing, got tip burn then collapsed and died. He had pictures to show, I asked him to send copies.01/03/05 VC: CALLED AND PLACED ORDER FOR 01/03/05 NN: He called 12-30-04, had problem with plants. He thinks plants were frozen to death, Mesabi and Honeoye were the worst. I will talk to him in Wisconson meeting.

what I would like the above memo field to do is this:

01/17/05 NN: His plant problems, etc.
01/03/05 VC: CALLED AND PLACED ORDER etc.,
01/03/05 NN: He called 12-30-04, had problem, etc

meaning, the date and initials and : would be one field, and the text would be a 2nd field. therefore, 1 memo field would be split into 6 fields, in this particular instance

I'm using crystal v10 reading a foxpro database with a memo field

please offer any help

thx

mary
 
It might be possible using for loop and looking for various 'clues' to break up the string. If I have time today, I will try to post a possible solution.
 
It might be possible using a loop and looking for various 'clues' to break up the string. If I have time today, I will try to post a possible solution.
 
I don't think this is quite what you had in mind, but hopefully close. It will list each item on it's own line.
I will think more about how to get the date/init and the contents on the same line.

anyway, maybe something like this.....

//{@Split and display}
stringvar array parts;
numbervar cntarray;
stringvar together;
numbervar iyi;

parts := split ({table.field,":");

IF isnull({table.field}) OR TRIM({table.field})=""
then together := " "
else
totext((
for iyi := 1 to cntarray
DO (together := parts[iyi] & chr(13))
));

together




 
thx very much - - - I'll give this a try
 
fischer -

I finally tried this today - - - it's returning 'true' or blank?

any idea why?

thanks
 
Did you add "together" as the final line of the formula? Also you need to format the formula to "can grow".

-LB
 
LB -

Thanks, I forgot to add "together" - - I did have "can grow" on, though...

Now that I add together I'm getting blank records -- - all of em

sample below of what I was reading in the text and then the formula I used:

text =
07/18/05 AT: wrote off finance charges....customer thought he had sent money in December for early pay...researched, check not received...apparently did not clear his bank either...so said I would write off finance charges.12/13/04 NN: He called to place order. "They were not as thick as other varieties."

formula =
stringvar array parts;
numbervar cntarray;
stringvar together;
numbervar iyi;

parts := split ({arcust01.cstmemo},":");

IF isnull({arcust01.cstmemo}) OR TRIM({arcust01.cstmemo})=""
then together := " "
else
totext((
for iyi := 1 to cntarray
DO (together := parts[iyi] & chr(13))
));

together
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top