Loading ...
Sorry, an error occurred while loading the content.

Converting lists to tables

Expand Messages
  • John Rethorst
    I often get lists that I want to convert to tables. A list of Nobel Prize in Literature winners, for example, shows on the web page as a four-column table with
    Message 1 of 4 , Mar 5, 2006
    • 0 Attachment
      I often get lists that I want to convert to tables. A list
      of Nobel Prize in Literature winners, for example, shows
      on the web page as a four-column table with year, name,
      country and language but, when I select and copy it and
      paste in WP, it lands as a single-column list:

      1901
      Sully Prudhomme
      France
      French
      1902
      Theodor Mommsen
      Germany
      German
      1903
      Bjørnstjerne Bjørnson
      Norway
      Norwegian
      1904
      Frédéric Mistral
      France
      Occitan

      To convert the list to a table, I run this macro:

      Get Integer (Var00;2;32;"List to Table";"How many columns?")
      Home ()
      Display (Off)
      Repeat
      Assign (Var01;PhysicalLine)
      Repeat
      Assign (Var02;Var02+1)
      Down ()
      Beginning of Line ()
      Delete
      Tab
      Beginning of Line ()
      Until (Var02+2>Var00)
      Assign (Var02;0)Down ()
      Until (Var01=PhysicalLine)
      ;
      Select All
      Convert Text To Table (Var00;Tab)
      Home ()
      Display (On)

      John R.
    • John Rethorst
      Corrected macro script: Get Integer (Var00;2;32; List to Table ; How many columns? ) Home () Display (Off) Repeat Assign (Var01;PhysicalLine) Repeat Assign
      Message 2 of 4 , Mar 5, 2006
      • 0 Attachment
        Corrected macro script:

        Get Integer (Var00;2;32;"List to Table";"How many columns?")
        Home ()
        Display (Off)
        Repeat
        Assign (Var01;PhysicalLine)
        Repeat
        Assign (Var02;Var02+1)
        Down ()
        Beginning of Line ()
        Delete
        Tab
        Beginning of Line ()
        Until (Var02+2>Var00)
        Assign (Var02;0)
        Down ()
        Until (Var01=PhysicalLine)
        ;
        Select All
        Convert Text To Table (Var00;Tab)
        Home ()
        Display (On)
      • pjandlar
        Cool, but it seems even easier and has fewer steps to just find/ replace all hrts to tabs, then select all and define a table with 4 columns. Pam
        Message 3 of 4 , Mar 5, 2006
        • 0 Attachment
          Cool, but it seems even easier and has fewer steps to just find/ replace all
          hrts to tabs, then select all and define a table with 4 columns.
          Pam
        • John Rethorst
          ... Way cool! I didn t know that specifying columns would have that effect on tab-delimited text. John R.
          Message 4 of 4 , Mar 5, 2006
          • 0 Attachment
            --- In wordperfectmac@yahoogroups.com, pjandlar <no_reply@...> wrote:
            >
            > Cool, but it seems even easier and has fewer steps to just
            > find/ replace all hrts to tabs, then select all and define a
            > table with 4 columns.
            > Pam

            Way cool! I didn't know that specifying columns would have
            that effect on tab-delimited text.

            John R.
          Your message has been successfully submitted and would be delivered to recipients shortly.