Import table from .rft in doors

Hello,

I'm new in DXL and I would like to import a table from .rtf in a door module.
Actually the script rtfim.dxl from doors import table in table.

Me, I got a table in the document .rtf, and I would like to get no table on Doors just objects.

For more information, looks in attaching files
SystemAdmin - Wed Dec 12 05:41:59 EST 2012

Re: Import table from .rft in doors
OurGuest - Wed Dec 12 07:24:41 EST 2012

Since you don't know DXL, perhaps a wise approach would be to preprocess the data to excel before putting into doors.

Re: Import table from .rft in doors
SystemAdmin - Wed Dec 12 08:08:38 EST 2012

OurGuest - Wed Dec 12 07:24:41 EST 2012
Since you don't know DXL, perhaps a wise approach would be to preprocess the data to excel before putting into doors.

I have bases in DXL.
My post on this forum is to obtain a beginning of assistance. And not to turn me towards another solution/program.

And echange with someones who already did something like that.

Import from rtf, get information, fix in doors, etc.

Cordially,

Re: Import table from .rft in doors
Mathias Mamsch - Wed Dec 12 08:31:30 EST 2012

SystemAdmin - Wed Dec 12 08:08:38 EST 2012
I have bases in DXL.
My post on this forum is to obtain a beginning of assistance. And not to turn me towards another solution/program.

And echange with someones who already did something like that.

Import from rtf, get information, fix in doors, etc.

Cordially,

Well, the question is what kind of help you want. Obviously people here have done imports - I guess the screenshot you posted shows the result that you want and for me it seems specific enough to assume that you will not get a pretailored script from anyone here that will solve your problem.

So how can we help? If your question is where to start, it seems that the RTF import script is a start because (and I hope I remember correctly it uses MS Word to actually do the import). The drawback of this is, that it does not handle all Situations well, so the better start would be the Export To DOORS word macro that ships with DOORS. However that macro is crypted, so it possibily leaves you with the RTF import script.

If it comes to making special adaptions to this script, you would need to have a specific description of the necessary changes and if you have, you preferred solution and specific questions that prevent you from implementing them.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Import table from .rft in doors
SystemAdmin - Wed Dec 12 09:31:02 EST 2012

Mathias Mamsch - Wed Dec 12 08:31:30 EST 2012
Well, the question is what kind of help you want. Obviously people here have done imports - I guess the screenshot you posted shows the result that you want and for me it seems specific enough to assume that you will not get a pretailored script from anyone here that will solve your problem.

So how can we help? If your question is where to start, it seems that the RTF import script is a start because (and I hope I remember correctly it uses MS Word to actually do the import). The drawback of this is, that it does not handle all Situations well, so the better start would be the Export To DOORS word macro that ships with DOORS. However that macro is crypted, so it possibily leaves you with the RTF import script.

If it comes to making special adaptions to this script, you would need to have a specific description of the necessary changes and if you have, you preferred solution and specific questions that prevent you from implementing them.

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

My principal request is : How to import these data under doors?

I saw the function importRTF, but, I would like importation cell by cell

Re: Import table from .rft in doors
SystemAdmin - Wed Dec 12 12:25:55 EST 2012

SystemAdmin - Wed Dec 12 09:31:02 EST 2012
My principal request is : How to import these data under doors?

I saw the function importRTF, but, I would like importation cell by cell

"importRTF" is a DOORS perm, so it's black box for us.

I think there are at least two ways to solve your problem:

  • Program your own RTF parser (there are some discussions about parsing RTF in this forum but IMHO that's a hard way to go).

  • do a two-step import. First step: let "importRTF" do the work (result: table in DOORS), second step: search for all(??) tables in the DOORS module (for oTable in entire module do -> if table (oTable) && !isDeleted (oTable) then ...) and for each table go through the lines (for oLine in table(oTable) do...) and the cells of the line (for oCell in line(oLine) do...) and, depending on the colum number you are in, either create a new object somewhere after the table or fill the last created object's according attribute. Afterwards delete the table (softDelete (oTable)).

Re: Import table from .rft in doors
Mathias Mamsch - Wed Dec 12 16:04:25 EST 2012

SystemAdmin - Wed Dec 12 09:31:02 EST 2012
My principal request is : How to import these data under doors?

I saw the function importRTF, but, I would like importation cell by cell

As I said, the easiest way is to use the MS Word import, since MS Word will give you the possibility to evaluate the table contents cell by cell. If you do NOT want to use the MS Word import then as Mike said, you would need to either write your own rtf parser or do a postprocessing in DOORS. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Import table from .rft in doors
llandale - Wed Dec 12 17:07:57 EST 2012

Looking at your example I see that Attr1 is in columns 0 and 2. But if Obj1 had an Attr2 value that would move Attr1 to column3. Then I wonder how any script could read Col2 and tell the difference between Attr2 for Obj1 and Attr1 for Obj2.

I think indeed you DO need to pre-process this in Excel, I guess with columns Attr1, ObjText, Attr2 and each row a separate object. Then save-as CSV and import it from DOORS.

As for the script you are asking for, I don't use API but I suspect it would look something like this outline:

Get OLE handle on the *.rtf file.
while(not end-of-file)
{  Cell = ReadNextCell from file
              // Extreme difficulty begins:
   use OLE to get Row number and Cell number
   if (new row) then obj = create a new object
   if (new object indicated by the cell) then obj = create a new object
   NameAttr = name of attr associated with this cell
              // Extreme difficult ends
   obj.NameAttr = Cell
}


-Louie

Re: Import table from .rft in doors
SystemAdmin - Thu Dec 13 03:12:30 EST 2012

llandale - Wed Dec 12 17:07:57 EST 2012

Looking at your example I see that Attr1 is in columns 0 and 2. But if Obj1 had an Attr2 value that would move Attr1 to column3. Then I wonder how any script could read Col2 and tell the difference between Attr2 for Obj1 and Attr1 for Obj2.

I think indeed you DO need to pre-process this in Excel, I guess with columns Attr1, ObjText, Attr2 and each row a separate object. Then save-as CSV and import it from DOORS.

As for the script you are asking for, I don't use API but I suspect it would look something like this outline:

Get OLE handle on the *.rtf file.
while(not end-of-file)
{  Cell = ReadNextCell from file
              // Extreme difficulty begins:
   use OLE to get Row number and Cell number
   if (new row) then obj = create a new object
   if (new object indicated by the cell) then obj = create a new object
   NameAttr = name of attr associated with this cell
              // Extreme difficult ends
   obj.NameAttr = Cell
}


-Louie

Thank you, for your answers.

cordially,