Topic
8 replies Latest Post - ‏2012-12-13T08:12:30Z by SystemAdmin
SystemAdmin
SystemAdmin
3180 Posts
ACCEPTED ANSWER

Pinned topic Import table from .rft in doors

‏2012-12-12T10:41:59Z |
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
Updated on 2012-12-13T08:12:30Z at 2012-12-13T08:12:30Z by SystemAdmin
  • OurGuest
    OurGuest
    163 Posts
    ACCEPTED ANSWER

    Re: Import table from .rft in doors

    ‏2012-12-12T12:24:41Z  in response to SystemAdmin
    Since you don't know DXL, perhaps a wise approach would be to preprocess the data to excel before putting into doors.
    • SystemAdmin
      SystemAdmin
      3180 Posts
      ACCEPTED ANSWER

      Re: Import table from .rft in doors

      ‏2012-12-12T13:08:38Z  in response to OurGuest
      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,
      • Mathias Mamsch
        Mathias Mamsch
        1937 Posts
        ACCEPTED ANSWER

        Re: Import table from .rft in doors

        ‏2012-12-12T13:31:30Z  in response to SystemAdmin
        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
        • SystemAdmin
          SystemAdmin
          3180 Posts
          ACCEPTED ANSWER

          Re: Import table from .rft in doors

          ‏2012-12-12T14:31:02Z  in response to Mathias Mamsch
          My principal request is : How to import these data under doors?

          I saw the function importRTF, but, I would like importation cell by cell
          • SystemAdmin
            SystemAdmin
            3180 Posts
            ACCEPTED ANSWER

            Re: Import table from .rft in doors

            ‏2012-12-12T17:25:55Z  in response to SystemAdmin
            "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)).
          • Mathias Mamsch
            Mathias Mamsch
            1937 Posts
            ACCEPTED ANSWER

            Re: Import table from .rft in doors

            ‏2012-12-12T21:04:25Z  in response to SystemAdmin
            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
  • llandale
    llandale
    2943 Posts
    ACCEPTED ANSWER

    Re: Import table from .rft in doors

    ‏2012-12-12T22:07:57Z  in response to SystemAdmin

    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

    Updated on 2014-01-06T14:21:51Z at 2014-01-06T14:21:51Z by iron-man
    • SystemAdmin
      SystemAdmin
      3180 Posts
      ACCEPTED ANSWER

      Re: Import table from .rft in doors

      ‏2012-12-13T08:12:30Z  in response to llandale
      Thank you, for your answers.

      cordially,