Remove Carriage Returns from an Attribute DXL

Hi,

I have a traceability column in a module that lists the objects linked to the current object. I want this to be passed to the Word file using RPE however it comes through as a list with carriage returns, and can take up an entire A4 page of just Object identifiers.

e.g.:

ID-1
ID-2
ID-3

How do I strip out the carriage returns so that I end up with a one-line list separated by spaces? e.g.:

ID-1 ID-2 ID-3

thanks,

I'll note that this statement above is in fact based upon this forum(RPE document):
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=403189&tstart=0#14730757
I just have the same issue, but in Rational DXL. I'd like also the ID's separated by a comma as well as a space. Thanks! John
btela2000 - Thu Mar 29 12:34:08 EDT 2012

Re: Remove Carriage Returns from an Attribute DXL
llandale - Thu Mar 29 15:00:40 EDT 2012

Don't know about the Export, but you can do this in your Attr-DXL. If you converted a layout to an Attr-DXL you should see near the top a function "display" or "displayRich". This accumulates the message to the global buffer, then add an EOL to the buffer. Change that to a space or more reasonably a comma-space.

-Louie

Re: Remove Carriage Returns from an Attribute DXL
btela2000 - Thu Mar 29 18:06:56 EDT 2012

llandale - Thu Mar 29 15:00:40 EDT 2012
Don't know about the Export, but you can do this in your Attr-DXL. If you converted a layout to an Attr-DXL you should see near the top a function "display" or "displayRich". This accumulates the message to the global buffer, then add an EOL to the buffer. Change that to a space or more reasonably a comma-space.

-Louie

Thanks Louie! I think i did it! You are certainly correct that i simply had a Layout Dxl converted to an attribuet DXL. I went and took a look at your recommendation to look at "DisplayRich" I'm quite a novice at the nomenctature of coding but I took a crack anyways. In the review, I found these lines below:


void addNewLineSeparator(Buffer& b)
{
if (length(b) > 0)
{
b += "\n"
}
}

void display(string s)


I took note of the line of code with the "\n". I recalled that this was the designator for a carraige return. I changed it to this below:
void addNewLineSeparator(Buffer& b)
{
if (length(b) > 0)
{
b += ", "
}
}

void display(string s)



...and it worked for only that object i had elected. I went ahead and selected all objects (made 'em pink) and then updated the attribute again and it worked for the entire document!

Louie, is this what you were speaking of or did i discover something different? I'm curious about your solution and would like to learn more.

thanks, John

Re: Remove Carriage Returns from an Attribute DXL
llandale - Fri Mar 30 09:59:12 EDT 2012

btela2000 - Thu Mar 29 18:06:56 EDT 2012
Thanks Louie! I think i did it! You are certainly correct that i simply had a Layout Dxl converted to an attribuet DXL. I went and took a look at your recommendation to look at "DisplayRich" I'm quite a novice at the nomenctature of coding but I took a crack anyways. In the review, I found these lines below:


void addNewLineSeparator(Buffer& b)
{
if (length(b) > 0)
{
b += "\n"
}
}

void display(string s)


I took note of the line of code with the "\n". I recalled that this was the designator for a carraige return. I changed it to this below:
void addNewLineSeparator(Buffer& b)
{
if (length(b) > 0)
{
b += ", "
}
}

void display(string s)



...and it worked for only that object i had elected. I went ahead and selected all objects (made 'em pink) and then updated the attribute again and it worked for the entire document!

Louie, is this what you were speaking of or did i discover something different? I'm curious about your solution and would like to learn more.

thanks, John

That looks right. I never convert since I write my own Attr-DXL, I was just suggesting from memory.

Re: Remove Carriage Returns from an Attribute DXL
btela2000 - Thu Apr 19 17:02:07 EDT 2012

I just realized i need to close this out. thank you for the help!!