Creating DXL script to cut and paste first word of paragraph as attribtues

Hello Everyone,

I am trying to create a DXL library script. I have a piece of text that is as follows all one Object in doors: "ABC-3.1.1.1-2    3.1.1.1  Car  This is a specific requirement that is written."

I want to do the following:

--remove "ABC-3.1.1.1-2" and place that text in an Legacy ID attribute

--Remove "3.1.1.1" and place that text in an Paragraph ID attribute

--Remove "Car" and place that text in an Requirement Title

Keep the " This is a specific requirement" text in the object with no spaces prior to it ( keeping the bolded word)

I can not seem to figure it out

 

Please help

 

 


Alex_4IBM - Mon Dec 21 08:46:37 EST 2015

Re: Creating DXL script to cut and paste first word of paragraph as attribtues
a8155058 - Mon Dec 21 09:29:56 EST 2015

Off the top of my head, you have two options here.

- User regular expressions

- User a combination of loops, buffers, and string length to look at each string character by character

Re: Creating DXL script to cut and paste first word of paragraph as attribtues
Jim Wetzel - Mon Dec 21 14:52:50 EST 2015

You can also export to excel then use string tools (e.g., find, left, right, len, mid)  to extract the data into new columns.  Once you have formulas automate the extraction, you can copy the columns with your new attributes and then paste using paste special - values only.  The resulting columns can be imported into DOORS.

For example, en excel, search for the first space, " ".  answer1=FIND(target cell, " ") The first work is LEFT (target cell, anser1-1).  To find the second word, start you search one character beyond the first space. answer2=FIND(target cell, " ", answer1=1)  It might take several columns to work it out.  again you don't want to import the underlying formulas, so copy the answers and 'paste special' to get just the string values before creating the import csv.

I guess it dxl or excel depend on whether this is one time or ongoing.  I'd use excel, simply form personal comfort, especially if its not  a repetitive task.

Re: Creating DXL script to cut and paste first word of paragraph as attribtues
Costas..Aravidis - Tue Dec 22 06:25:03 EST 2015

I think this topic is the same...

https://www.ibm.com/developerworks/community/forums/html/topic?id=5da4837c-ef11-48d1-8aa9-3d8fba04d529