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

Using :argdo w! >> combined.xml

Expand Messages
  • Russ Urquhart
    Hi, I used the above command to concatenate files to a single combined.xml file. The problem is I can t remember how I had all of the XML files from the
    Message 1 of 8 , Apr 9, 2013
      Hi,

      I used the above command to concatenate files to a single combined.xml file. The problem is I can't remember how I had all of the XML files from the directory loaded into vim to get this command to work.

      Can anyone help jog my memory on this?

      Thanks

      Russ

      Sent from my iPhone

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Taylor Hedberg
      ... list of files you give on the command line when launching Vim. You can also set it manually from within Vim by using the :args command.
      Message 2 of 8 , Apr 9, 2013
        :argdo iterates over the argument list. This is set implicitly by the
        list of files you give on the command line when launching Vim. You can
        also set it manually from within Vim by using the :args command.

        :help :argdo
        :help :args
        :help argument-list
      • Russ Urquhart
        Thanks that was it! I ll write it down this time!! Sent from my iPhone ... -- -- You received this message from the vim_use maillist. Do not top-post! Type
        Message 3 of 8 , Apr 9, 2013
          Thanks that was it!
          I'll write it down this time!!

          Sent from my iPhone

          On Apr 9, 2013, at 1:02 PM, Taylor Hedberg <tmhedberg@...> wrote:

          > :argdo iterates over the argument list. This is set implicitly by the
          > list of files you give on the command line when launching Vim. You can
          > also set it manually from within Vim by using the :args command.
          >
          > :help :argdo
          > :help :args
          > :help argument-list

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Russell Urquhart
          Hi all, This comes on the heels of Taylor helping me to remember how to bring all the files in a given directory into a single file in Vim. For this particular
          Message 4 of 8 , Apr 9, 2013
            Hi all,

            This comes on the heels of Taylor helping me to remember how to bring all the files in a given directory into a single file in Vim.

            For this particular document(s) i might have to create, is there a way to choose the order of the files in the given directory, and have them load, in that order, into a single file.

            The order is probably going to be specific to what my users want, and not sorted by any manner.

            Can anyone suggest the best way to do this in Vim?

            Thanks again to all of you, and thanks again to Taylor!

            Russ

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Tim Chase
            ... Presuming you want to control the order of the files by having them listed one-per-line in a file, you could do something like ... This looks at each line
            Message 5 of 8 , Apr 9, 2013
              On 2013-04-09 18:46, Russell Urquhart wrote:
              > The order is probably going to be specific to what my users want,
              > and not sorted by any manner.
              >
              > Can anyone suggest the best way to do this in Vim?

              Presuming you want to control the order of the files by having them
              listed one-per-line in a file, you could do something like

              :g/^/exe 'sview '.getline('.')|w!>>output.txt|q

              This looks at each line in your order-control file, splits to open
              the file named on the line (using ":sview" so it's read-only), writes
              the contents (appending) to "output.txt", then quits the split
              window, leaving you back in your original order-control file.

              -tim




              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Ben Fritz
              ... Your solution for all the files in a directory used the arglist. I presume you opened them all with a wildcard. If you want to specify an order, don t use
              Message 6 of 8 , Apr 9, 2013
                On Tuesday, April 9, 2013 6:46:50 PM UTC-5, russur wrote:
                >
                > For this particular document(s) i might have to create, is there a way to choose the order of the files in the given directory, and have them load, in that order, into a single file.
                >
                >
                >
                > The order is probably going to be specific to what my users want, and not sorted by any manner.
                >
                >
                >
                > Can anyone suggest the best way to do this in Vim?
                >

                Your solution for all the files in a directory used the arglist. I presume you opened them all with a wildcard.

                If you want to specify an order, don't use a wildcard, just list them out in the order you want. You could even add more after creating the arglist with the :argadd command.

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Shlomi Fish
                Hi Russ, please don t start a new thread by replying to an existing message. Instead, write a new message to vim_use@googlegroups.com . I could tell that was
                Message 7 of 8 , Apr 9, 2013
                  Hi Russ,

                  please don't start a new thread by replying to an existing message. Instead,
                  write a new message to vim_use@... . I could tell that was the
                  case here by my mailer's threading capabilities.

                  Regards,

                  Shlomi Fish

                  On Tue, 09 Apr 2013 18:46:50 -0500
                  Russell Urquhart <russurquhart1@...> wrote:

                  > Hi all,
                  >
                  > This comes on the heels of Taylor helping me to remember how to bring all the
                  > files in a given directory into a single file in Vim.
                  [SNIPPED]

                  --
                  -----------------------------------------------------------------
                  Shlomi Fish http://www.shlomifish.org/
                  First stop for Perl beginners - http://perl-begin.org/

                  Dax: yep, space. Nothing but nothing all around.
                  — Star Trek, “We, the Living Dead” by Shlomi Fish

                  Please reply to list if it's a mailing list post - http://shlom.in/reply .

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Russell Urquhart
                  We ll do, sorry about that! Russ ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
                  Message 8 of 8 , Apr 10, 2013
                    We'll do, sorry about that!

                    Russ


                    On Wed, Apr 10, 2013 at 07:14:31AM +0300, Shlomi Fish wrote:
                    > Hi Russ,
                    >
                    > please don't start a new thread by replying to an existing message. Instead,
                    > write a new message to vim_use@... . I could tell that was the
                    > case here by my mailer's threading capabilities.
                    >
                    > Regards,
                    >
                    > Shlomi Fish
                    >
                    > On Tue, 09 Apr 2013 18:46:50 -0500
                    > Russell Urquhart <russurquhart1@...> wrote:
                    >
                    > > Hi all,
                    > >
                    > > This comes on the heels of Taylor helping me to remember how to bring all the
                    > > files in a given directory into a single file in Vim.
                    > [SNIPPED]
                    >
                    > --
                    > -----------------------------------------------------------------
                    > Shlomi Fish http://www.shlomifish.org/
                    > First stop for Perl beginners - http://perl-begin.org/
                    >
                    > Dax: yep, space. Nothing but nothing all around.
                    > — Star Trek, “We, the Living Dead” by Shlomi Fish
                    >
                    > Please reply to list if it's a mailing list post - http://shlom.in/reply .
                    >
                    > --
                    > --
                    > You received this message from the "vim_use" maillist.
                    > Do not top-post! Type your reply below the text you are replying to.
                    > For more information, visit http://www.vim.org/maillist.php
                    >
                    > ---
                    > You received this message because you are subscribed to the Google Groups "vim_use" group.
                    > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    > For more options, visit https://groups.google.com/groups/opt_out.
                    >
                    >

                    --
                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  Your message has been successfully submitted and would be delivered to recipients shortly.