I fiddled with this for a while -- you should be able to do it with a
single regexp.

The problem is complicated because of newline characters (2 after each
element) and one after the name MATTHEW .

So, rather than beat it to death I came up with the code below:

HTH

Dick

  <cfset source =

  '=============STAMP: 2004/06/23 14:54:45 MATTHEW
  I just called and Confirmed Jane Smiling with Teresa on the 4th.

  =============STAMP: 2004/06/22 15:33:37 MATTHEW
  Teresa had already filled the need that Denise just called in.

  =============STAMP: 2004/06/22 15:09:47 MATTHEW
  Denise Hooper called in an ICU need for tonight.
'
/>

<cfset sourceList = ReReplace(source, "(?m)\n\n", "|", "all") />
<cfset sourceList = ReReplace(sourceList, "MATTHEW \n", "", "all") />
<cfset sourceList = ReReplace(sourceList, "=============STAMP:  ", "",
"all") />

<cfoutput><br>ListLen......#ListLen(sourceList, "|")#</cfoutput>

<cfloop List=#sourceList# index="theListEntry" delimiters="|">
   <cfoutput><br>#theListEntry#</cfoutput>
</cfloop>

This yields:

ListLen......3
2004/06/23 14:54:45 I just called and Confirmed Jane Smiling with
Teresa on the 4th.
2004/06/22 15:33:37 Teresa had already filled the need that Denise just
called in.
2004/06/22 15:09:47 Denise Hooper called in an ICU need for tonight.

On Jul 1, 2004, at 12:20 PM, Kyle Murphy wrote:

> I have a column of data that I need to parse through to create separate
>  journal entries.��The data is currently in the below form
>
>
>  =============STAMP: 2004/06/23 14:54:45 MATTHEW
>  I just called and Confirmed Jane Smiling with Teresa on the 4th.
>
>  =============STAMP: 2004/06/22 15:33:37 MATTHEW
>  Teresa had already filled the need that Denise just called in.
>
>  =============STAMP: 2004/06/22 15:09:47 MATTHEW
>  Denise Hooper called in an ICU need for tonight.
>  Since there is uniformity for each note, I would think that there is
>  some way to parse through this and create 3 separate records.��For
>  example,
>
>
>  NoteDate��������������������Note
>  ----------------�����������---------
>  2004/06/23 14:54:45���������I just called and Confirmed Jane Smiling
>  with Teresa on the 4th.
>  2004/06/22 15:33:37���������Teresa had already filled the need that
>  Denise just called in.
>  2004/06/22 15:09:47���������Denise Hooper called in an ICU need for
>  tonight.
>
>
>  Does anyone have some idea on how I can do this?��I'm stumped.
>
>
>  Thank you,
>  Kyle
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to