Hi everybody,
Given a table contained a record:

a b c
================================
a1 xyz (memo)

where (memo) is the memo field contained the following:
dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso

dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.

dsahguhhdi dhijdi

In this memo field, three paragraphs involved. My question is that is it
possible to diverse this record into three records by the paragraph, that
means:

a b c
================================
a1 xyz 1st paragraph
a1 xyz 2nd paragraph
a1 xyz 3rd paragraph

And the data type for c remained unchanged, i.e. memo field!!

Thanks and regards,
Patrick the Statistics

Re: divid the memo field into several records by Bernhard

Bernhard
Mon Jul 02 06:05:24 CDT 2007

Hi Patrick

> Given a table contained a record:
>
> a b c
> ================================
> a1 xyz (memo)
>
> where (memo) is the memo field contained the following:
> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>
> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>
> dsahguhhdi dhijdi
>
> In this memo field, three paragraphs involved. My question is that is it
> possible to diverse this record into three records by the paragraph,
> that means:
>
> a b c
> ================================
> a1 xyz 1st paragraph
> a1 xyz 2nd paragraph
> a1 xyz 3rd paragraph
>
> And the data type for c remained unchanged, i.e. memo field!!
It is possible. There is no built in command or function that does it for you,
but it should be quite easy to write a string function that cuts the memo field
in pieces. With these pieces, you simply add some new records to the (target-)table.

Regards
Bernhard Sander

Re: divid the memo field into several records by Josh

Josh
Mon Jul 02 17:21:17 CDT 2007

>> And the data type for c remained unchanged, i.e. memo field!!
>It is possible. There is no built in command or function that does it for you,
>but it should be quite easy to write a string function that cuts the memo field
>in pieces. With these pieces, you simply add some new records to the (target-)table.

why not use getwordnum() and use the cr/lf pair as your delimeter?


Re: divid the memo field into several records by Olaf

Olaf
Tue Jul 03 02:20:53 CDT 2007

> why not use getwordnum() and use the cr/lf pair as your delimeter?
For paragraphs the double crlf pair:

for lnParagraphCount = 1 to getwordcount(c,chr(13)+chr(10)+chr(13)+chr(10))
? getwordnum(c,lnParagraphCount,chr(13)+chr(10)+chr(13)+chr(10))
endfor

Bye, Olaf.



Re: divid the memo field into several records by Anders

Anders
Tue Jul 03 05:39:39 CDT 2007


Use STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence
where cBeginDelim and cEndDelim is CHR(13)+CHR(10)
to extract the first paragraph, then loop for the rest.

FOR i = 1 TO MEMLINES (mymemo)
lcParagraph=STREXTRACT(mymemo, chr(13)+chr(10) ,chr(13)+chr(10) , M.i
INSERT ...
NEXT

-Anders

"Patrick" <patrick.stat@gmail.com> wrote in message
news:eHsI$5GvHHA.1340@TK2MSFTNGP02.phx.gbl...
> Hi everybody,
> Given a table contained a record:
>
> a b c
> ================================
> a1 xyz (memo)
>
> where (memo) is the memo field contained the following:
> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>
> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>
> dsahguhhdi dhijdi
>
> In this memo field, three paragraphs involved. My question is that is it
> possible to diverse this record into three records by the paragraph, that
> means:
>
> a b c
> ================================
> a1 xyz 1st paragraph
> a1 xyz 2nd paragraph
> a1 xyz 3rd paragraph
>
> And the data type for c remained unchanged, i.e. memo field!!
>
> Thanks and regards,
> Patrick the Statistics



Re: divid the memo field into several records by Josh

Josh
Tue Jul 03 09:18:20 CDT 2007

Well; caveat on that...
memlines() uses the value of set memo.... so you need to be sure your paragraphs
are correctly sized, line length wise....

Also; this assumes that there's a leading and ending crlf pair.... no?

On Tue, 3 Jul 2007 12:39:39 +0200, "Anders Altberg" <anders.altberg> wrote:

>
>Use STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence
>where cBeginDelim and cEndDelim is CHR(13)+CHR(10)
>to extract the first paragraph, then loop for the rest.
>
>FOR i = 1 TO MEMLINES (mymemo)
>lcParagraph=STREXTRACT(mymemo, chr(13)+chr(10) ,chr(13)+chr(10) , M.i
>INSERT ...
>NEXT
>
>-Anders
>
>"Patrick" <patrick.stat@gmail.com> wrote in message
>news:eHsI$5GvHHA.1340@TK2MSFTNGP02.phx.gbl...
>> Hi everybody,
>> Given a table contained a record:
>>
>> a b c
>> ================================
>> a1 xyz (memo)
>>
>> where (memo) is the memo field contained the following:
>> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>>
>> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
>> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
>> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>>
>> dsahguhhdi dhijdi
>>
>> In this memo field, three paragraphs involved. My question is that is it
>> possible to diverse this record into three records by the paragraph, that
>> means:
>>
>> a b c
>> ================================
>> a1 xyz 1st paragraph
>> a1 xyz 2nd paragraph
>> a1 xyz 3rd paragraph
>>
>> And the data type for c remained unchanged, i.e. memo field!!
>>
>> Thanks and regards,
>> Patrick the Statistics
>


Re: divid the memo field into several records by Anders

Anders
Tue Jul 03 16:41:06 CDT 2007

This is what I had in mind:

CLEAR
#DEFINE CRLF CHR(13)+CHR(10)
TEXT TO x NOSHOW
aa aa
b bbb
ccc c
Dd d d, dd
ENDTEXT
nn=OCCURS(CRLF,x)
? 1, STREXTRACT(x,'',CRLF, 1)
FOR i = 1 TO nn
? i+1, STREXTRACT(x,CRLF,CRLF, M.i)
NEXT
?? STREXTRACT(x,CRLF,'',nn)

-Anders


"Josh Assing" <XjoshX@jAssing.com> wrote in message
news:ejmk83hs8omovts47qercv5ucninra8ds1@4ax.com...
> Well; caveat on that...
> memlines() uses the value of set memo.... so you need to be sure your
> paragraphs
> are correctly sized, line length wise....
>
> Also; this assumes that there's a leading and ending crlf pair.... no?
>
> On Tue, 3 Jul 2007 12:39:39 +0200, "Anders Altberg" <anders.altberg>
> wrote:
>
>>
>>Use STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence
>>where cBeginDelim and cEndDelim is CHR(13)+CHR(10)
>>to extract the first paragraph, then loop for the rest.
>>
>>FOR i = 1 TO MEMLINES (mymemo)
>>lcParagraph=STREXTRACT(mymemo, chr(13)+chr(10) ,chr(13)+chr(10) , M.i
>>INSERT ...
>>NEXT
>>
>>-Anders
>>
>>"Patrick" <patrick.stat@gmail.com> wrote in message
>>news:eHsI$5GvHHA.1340@TK2MSFTNGP02.phx.gbl...
>>> Hi everybody,
>>> Given a table contained a record:
>>>
>>> a b c
>>> ================================
>>> a1 xyz (memo)
>>>
>>> where (memo) is the memo field contained the following:
>>> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>>>
>>> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
>>> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
>>> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>>>
>>> dsahguhhdi dhijdi
>>>
>>> In this memo field, three paragraphs involved. My question is that is it
>>> possible to diverse this record into three records by the paragraph,
>>> that
>>> means:
>>>
>>> a b c
>>> ================================
>>> a1 xyz 1st paragraph
>>> a1 xyz 2nd paragraph
>>> a1 xyz 3rd paragraph
>>>
>>> And the data type for c remained unchanged, i.e. memo field!!
>>>
>>> Thanks and regards,
>>> Patrick the Statistics
>>
>



Re: divid the memo field into several records by Josh

Josh
Wed Jul 04 07:56:15 CDT 2007


I still think getwordnum() would be better/cleaner -- but that's just me.

On Tue, 3 Jul 2007 23:41:06 +0200, "Anders Altberg" <anders.altberg> wrote:

>This is what I had in mind:
>
>CLEAR
>#DEFINE CRLF CHR(13)+CHR(10)
>TEXT TO x NOSHOW
> aa aa
>b bbb
>ccc c
>Dd d d, dd
>ENDTEXT
>nn=OCCURS(CRLF,x)
>? 1, STREXTRACT(x,'',CRLF, 1)
>FOR i = 1 TO nn
>? i+1, STREXTRACT(x,CRLF,CRLF, M.i)
>NEXT
>?? STREXTRACT(x,CRLF,'',nn)
>
>-Anders
>
>
>"Josh Assing" <XjoshX@jAssing.com> wrote in message
>news:ejmk83hs8omovts47qercv5ucninra8ds1@4ax.com...
>> Well; caveat on that...
>> memlines() uses the value of set memo.... so you need to be sure your
>> paragraphs
>> are correctly sized, line length wise....
>>
>> Also; this assumes that there's a leading and ending crlf pair.... no?
>>
>> On Tue, 3 Jul 2007 12:39:39 +0200, "Anders Altberg" <anders.altberg>
>> wrote:
>>
>>>
>>>Use STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [, nOccurrence
>>>where cBeginDelim and cEndDelim is CHR(13)+CHR(10)
>>>to extract the first paragraph, then loop for the rest.
>>>
>>>FOR i = 1 TO MEMLINES (mymemo)
>>>lcParagraph=STREXTRACT(mymemo, chr(13)+chr(10) ,chr(13)+chr(10) , M.i
>>>INSERT ...
>>>NEXT
>>>
>>>-Anders
>>>
>>>"Patrick" <patrick.stat@gmail.com> wrote in message
>>>news:eHsI$5GvHHA.1340@TK2MSFTNGP02.phx.gbl...
>>>> Hi everybody,
>>>> Given a table contained a record:
>>>>
>>>> a b c
>>>> ================================
>>>> a1 xyz (memo)
>>>>
>>>> where (memo) is the memo field contained the following:
>>>> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>>>>
>>>> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
>>>> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
>>>> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>>>>
>>>> dsahguhhdi dhijdi
>>>>
>>>> In this memo field, three paragraphs involved. My question is that is it
>>>> possible to diverse this record into three records by the paragraph,
>>>> that
>>>> means:
>>>>
>>>> a b c
>>>> ================================
>>>> a1 xyz 1st paragraph
>>>> a1 xyz 2nd paragraph
>>>> a1 xyz 3rd paragraph
>>>>
>>>> And the data type for c remained unchanged, i.e. memo field!!
>>>>
>>>> Thanks and regards,
>>>> Patrick the Statistics
>>>
>>
>


Re: divid the memo field into several records by Anders

Anders
Wed Jul 04 14:08:00 CDT 2007

I agree.
-Anders

"Josh Assing" <XjoshX@jAssing.com> wrote in message
news:b56n83lubu6fa2k64rapuj3qcfloq4eth4@4ax.com...
>
> I still think getwordnum() would be better/cleaner -- but that's just me.
>
> On Tue, 3 Jul 2007 23:41:06 +0200, "Anders Altberg" <anders.altberg>
> wrote:
>
>>This is what I had in mind:
>>
>>CLEAR
>>#DEFINE CRLF CHR(13)+CHR(10)
>>TEXT TO x NOSHOW
>> aa aa
>>b bbb
>>ccc c
>>Dd d d, dd
>>ENDTEXT
>>nn=OCCURS(CRLF,x)
>>? 1, STREXTRACT(x,'',CRLF, 1)
>>FOR i = 1 TO nn
>>? i+1, STREXTRACT(x,CRLF,CRLF, M.i)
>>NEXT
>>?? STREXTRACT(x,CRLF,'',nn)
>>
>>-Anders
>>
>>
>>"Josh Assing" <XjoshX@jAssing.com> wrote in message
>>news:ejmk83hs8omovts47qercv5ucninra8ds1@4ax.com...
>>> Well; caveat on that...
>>> memlines() uses the value of set memo.... so you need to be sure your
>>> paragraphs
>>> are correctly sized, line length wise....
>>>
>>> Also; this assumes that there's a leading and ending crlf pair.... no?
>>>
>>> On Tue, 3 Jul 2007 12:39:39 +0200, "Anders Altberg" <anders.altberg>
>>> wrote:
>>>
>>>>
>>>>Use STREXTRACT(cSearchExpression, cBeginDelim [, cEndDelim [,
>>>>nOccurrence
>>>>where cBeginDelim and cEndDelim is CHR(13)+CHR(10)
>>>>to extract the first paragraph, then loop for the rest.
>>>>
>>>>FOR i = 1 TO MEMLINES (mymemo)
>>>>lcParagraph=STREXTRACT(mymemo, chr(13)+chr(10) ,chr(13)+chr(10) , M.i
>>>>INSERT ...
>>>>NEXT
>>>>
>>>>-Anders
>>>>
>>>>"Patrick" <patrick.stat@gmail.com> wrote in message
>>>>news:eHsI$5GvHHA.1340@TK2MSFTNGP02.phx.gbl...
>>>>> Hi everybody,
>>>>> Given a table contained a record:
>>>>>
>>>>> a b c
>>>>> ================================
>>>>> a1 xyz (memo)
>>>>>
>>>>> where (memo) is the memo field contained the following:
>>>>> dvud shijdjd dhjsodjds dguhijhisa dghhdaijodk dhuadhijoaka sahiasijaso
>>>>>
>>>>> dhdsdsjidjldslkdpjdf dfhfdhfijodjfsfah sddhdijosdksad shidjokpdbjhd
>>>>> dshisdjdhjijhfjsf sfuhshfd fghubjfd dghjuhsihjs shguhidn
>>>>> dhshsdij dguhuhd dshiihijodsa dhushdsjodsk.
>>>>>
>>>>> dsahguhhdi dhijdi
>>>>>
>>>>> In this memo field, three paragraphs involved. My question is that is
>>>>> it
>>>>> possible to diverse this record into three records by the paragraph,
>>>>> that
>>>>> means:
>>>>>
>>>>> a b c
>>>>> ================================
>>>>> a1 xyz 1st paragraph
>>>>> a1 xyz 2nd paragraph
>>>>> a1 xyz 3rd paragraph
>>>>>
>>>>> And the data type for c remained unchanged, i.e. memo field!!
>>>>>
>>>>> Thanks and regards,
>>>>> Patrick the Statistics
>>>>
>>>
>>
>