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

get the last comment from string field...

Status
Not open for further replies.

abhi900

IS-IT--Management
Jul 1, 2010
117
AU
i have a big txt field which basically holds all the comments made by any individual person who was last working on it.
the field goes something like this :-

Desmond Choo <dchoo>, 3/02/2011: " Comments in here "
________________________________________
Michael K Chen <al-MichaelKChen>, 7/02/2011: " Comments in here "

________________________________________
Desmond Choo <dchoo>, 8/02/2011: " Comments in here "
________________________________________
Binh Tran <tel-BinhTran>, 8/02/2011: " Comments in here "
________________________________________
Binh Tran <tel-BinhTran>, 10/03/2011: " Comments in here "
________________________________________
Puneet Chhabra <tel-puneetc>, 28/03/2011: " Comments in here "

The field which holds this is {BUG.BG_DEV_COMMENTS}.

Can anyone please suggest a way to get only the name of the last person who made a comment along with the comments made.

When i place this comments field onto the report against each data in detail section it comes out like the following :

</b></font><br><font color="#000080"><b>Binh Tran &lt;tel-BinhTran&gt;, 7/03/2011: </b></font> Hi Puneet,<br>Can you please have a look at this defect numbered 85 and advise. It is a minor defect. Thanks<br><font color="#000080"><b>.

please advise,

regards
 
Can you please show an example of the field that shows more than one person? Thanks.

-LB
 
hi Lbass,
below is how the field looks when it has more than 1 person commenting:-
</b></font><br><font color="#000080"><b>Bright Singh &lt;al-brightsingh&gt;, 2/22/2011: </b></font> Remark added in the Description. I confirm the input from Bing Zhao. mtu-size configuration for EVC is not possible through the Pro-Vision v1.7<br><font color="#000080"><b>________________________________________</b></font><br><font color="#000080"><b>Ivana Lambrechts &lt;al-ivanalambrechts&gt;, 1/03/2011: </b></font> <br><br>MTU size configuration for EVC is not possible through Pro-vision V1.7<br>NTU EMS WS to provide correction within RP1 delivery<br><font color="#000080"><b>________________________________________</b></font><br><font color="#000080"><b>Aygun Ozkan &lt;aozkan&gt;, 16/03/2011: </b></font> <br><br>Why is this defect CRITICAL? Given that the MTU size can be changed through port attributes? How many test cases is it blocking?<br><br>Are people following the defect management process or using their feelings for determining severity of defects?<br><br>PV1.8 now available to Telstra has the fix for this defect. Waiting retest.<br><font color="#000080"><b>________________________________________</b></font><br><font color="#000080"><b>Ivana Lambrechts &lt;al-ivanalambrechts&gt;, 17/03/2011: </b></font> <br>Defect critical/ low priority.<br>Critical: EVC should be created using GUI only ( no need for NTU CLI access)<br>Low: Testing can proceed with testing as CLI mode can be used in the model environement.</body></html>
 
Try this:

stringvar x :={BUG.BG_DEV_COMMENTS};
stringvar array y := split(x,"<b>________________________________________</b>");
y[ubound(y)]

-LB
 
Lbass,
i do know what the function Ubound means, however can you please explain the logic to me ?

thanks sooo mch and it worked liked a charm.

regards
 
This could also have been written:

stringvar array y := split({BUG.BG_DEV_COMMENTS},"<b>________________________________________</b>");
y[ubound(y)]

The split function is breaking the comment into sections wherever it sees: b>________________________________________</b>. The sections are the content of the array "y". The ubound function returns the number of the last number in the array, so that it can be used as a subscript to identify that last member of the array.

-LB
 
thnx sooo mch..

u r one very smart smart cookie.

thnks heaps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top