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

Multiple spaces > tab macro

Expand Messages
  • John Rethorst
    I find tables on the net where in each row the text of the first column is separated from the second column by some number of spaces – a varying number,
    Message 1 of 3 , Oct 5, 2005
    • 0 Attachment
      I find tables on the net where in each row the text of the first column is separated from the
      second column by some number of spaces – a varying number, depending on how the
      writer formatted it with the font used etc., and I want to replace each group of multiple
      spaces with a tab. This macro searches from the insertion point forward for multiple
      spaces, replacing each set with a tab:

      Find/Change Direction (Forward;No Wrap)
      Find/Change Where ({Current Doc})
      Find/Change Match (Partial Word;Case Insensitive;Alphabet Insensitive;CharRep
      Insensitive;{Text Only})
      Find/Change Action (Select Match)
      Find String ("[Language:English (USA)][Font:Geneva][Size:12] ")
      ;
      Repeat
      Find
      If (!FindStatusFlag)
      Find/Change Reset
      Alert ("I could not find any more multiple spaces in this document.")
      Return
      End If
      ;
      Repeat
      Raw Read (char;Right)
      Until (RawObject!=" ")
      Left (Select)
      Tab
      Until (!FindStatusFlag)

      John R.
    • John Rethorst
      This line: Find/Change Match (Partial Word;Case Insensitive;Alphabet Insensitive;CharRep Insensitive; {Text Only}) is all one line in the macro editor. John R.
      Message 2 of 3 , Oct 5, 2005
      • 0 Attachment
        This line:

        Find/Change Match (Partial Word;Case Insensitive;Alphabet Insensitive;CharRep Insensitive;
        {Text Only})

        is all one line in the macro editor.

        John R.
      • John Rethorst
        ... To clarify: this macro doesn t search for e.g. five spaces, but for varying numbers of multiple spaces. One line could have 12; the next 17. The macro
        Message 3 of 3 , Oct 6, 2005
        • 0 Attachment
          --- In wordperfectmac@yahoogroups.com, "John Rethorst" <jrethorst@y...> wrote:
          >
          > I find tables on the net where in each row the text of the first column is separated from the
          > second column by some number of spaces – a varying number, depending on how the
          > writer formatted it with the font used etc., and I want to replace each group of multiple
          > spaces with a tab. This macro…

          To clarify: this macro doesn't search for e.g. five spaces, but for varying numbers of
          multiple spaces. One line could have 12; the next 17. The macro searches for
          groups of multiple spaces, no matter how many, and replaces each group with a tab.

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