Hi Robert,

apologies for causing any confusion. I was asked to present the data stored in the database table column in a certain way. Historically data stored in this column is as under:

timestamp
comments

EX:

*** 05/12/2003 09:52:10 USER1 ***
closing if fixed - awaitng response from User2

I was asked to get rid of the stars and reorder the timestamp to something like this:

USER1 05/12/2003 09:52:10
(Username, Date, Time)

All comments (timestamps) added henceforth will be added in this fashion.
I hope this gives you a better understanding. The solution Pascal provided does just that and it does the job for me.

Best Regards,
cfcoder

> My bad, I responded to Pascal earlier... Sorry about that.
>
> CFCODER:
>
> You have shown your data two ways, and this impacts any solution that
> is presented:
>
> Latest:
> *** 05/12/2003  09:52:10  USER1 ***
> closing if fixed - awaitng response from User2
>


> *** 04/12/2003  18:55:18  USER2 ***
> Have been there, however user was on air shortly after, will try again
> in a bit.
>


> *** 04/12/2003  18:13:22  USER3 ***
> Roger that
>


> *** 04/12/2003  18:05:01  USER4 ***
> closed
>
> Originally:
>
> *** User1 10/28/2003 2:53:52 ***


>
> THIS IS A TEST


>
> *** User 2 04/06/2003  13:41:47 ***


>
> blah, blah
>
>
> So which is it?
>
> Also, I may have missed this answer, but it seems to me that the
> solution is to drop the separate data elements into their own fields
> in the database IN THE FIRST PLACE.  That way they can be queried out,
> or barring that solution, change the code that writes each entry to
> include delimiters
> e.g.
> *** User 2|04/06/2003|13:41:47***blah, blah
>
> And use CR/LF between fields to separate records...
>
> I'm sorry if this doesn't help, but the fact is you are dealing with
> output that sorely needs to be reformatted to make it easier to
> process. You shouldn't need anything major to pull it apart.
>
> Thanks,
> Robert
>
> P.S. What are the rules for the data that you are pulling apart now?
> e.g.  
> 3 asterisks, space date, 2 spaces, time, 2 spaces, username, 2 spaces,
> 3 asterisks, comment, cr/lf, cr/lf
> 3 asterisks, space date, 2 spaces, time, 2 spaces, username, 2 spaces,
> 3 asterisks, comment, cr/lf, cr/lf
> etc...
>
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 17, 2004 8:32 A
> To: CF-Talk
> Subject: Re: help with string manipulation (Find,Replace)
>
>
> Pascal, sorry again for being such a PEST. I really do apprecaite your
> help.
>
> There can be more than one occurance of the timestamp in the comment
> column. Ex:
>
> *** 05/12/2003  09:52:10  USER1 ***
> closing if fixed - awaitng response from User2
>


> *** 04/12/2003  18:55:18  USER2 ***
> Have been there, however user was on air shortly after, will try again
> in a bit.
>


> *** 04/12/2003  18:13:22  USER3 ***
> Roger that
>


> *** 04/12/2003  18:05:01  USER4 ***
> closed
>
> Can you please add code in your script to handle this and display all
> timestamps correctly
>
> Many thanks again
> cfcoder
>
>
>
>
>
>
>
> >thanks Pascal! It doesn't quite work how I would like it to.
> >
> >EX: *** 08/12/2003  20:33:31  EDWARI31 ***
> >
> >You code displays the above timestamp like this:
> >
> >0 8/12/2003 20:33:31  
> >
> >Where as I would like it to be displayed like this:
> >
> >EDWARI31 08/12/2003 20:33:31
> >
> >I dumped stTmp <cfdump var="#stTmp#">. This is what it returns
> >
> >struct
> >LEN
> >array  
> >1 38  
> >2 2  
> >3 9  
> >4 8  
> >5 11  
> >
> >POS
> >array  
> >1 1  
> >2 4  
> >3 6  
> >4 17  
> >5 25
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to