From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32037 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Kingett Newsgroups: gmane.text.pandoc Subject: Re: Merging and converting a Windows folder? Date: Thu, 19 Jan 2023 12:44:16 -0800 (PST) Message-ID: <935e5a2c-a0cf-4afa-8303-e62db5af072cn@googlegroups.com> References: <8da3b66e-f14a-49d3-9b65-826df906073an@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2946_1188184726.1674161056671" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7022"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCQNXJVFZIBRBIOXU2PAMGQEZDCOZNY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 19 21:44:22 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIbll-0001cc-LI for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 19 Jan 2023 21:44:21 +0100 Original-Received: by mail-ot1-f57.google.com with SMTP id 46-20020a9d0331000000b00684ce0aa309sf1553436otv.9 for ; Thu, 19 Jan 2023 12:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=5WoQZXf/Qu4osArNN09Iz8PGbluQlaT3uNWmprLEih4=; b=QQT7Zp9YmT3pD0FbBG17rcTZwaCbhLDcpia8mH7tCHI+izpuLEm9EYw9NPNFaPHvNf 08WXLDzYoFDghNXx+wnD1sbQfXsAt37QKB+nucewPjm9YnmDxjxQa5mFd7s5PMjWoleq IGom+HV6WZMyhSRP4CzuhtvIxNmWs48FXiSk7E6JnfowEp/ylkOOosS/LQEzbYZbLcT2 t/e8kZUpLISwa9wdMBVVx66oqVDFHXHBbUkXcVvGNY64HKYDXWf9fXPydkpGIRFvDamU xZoS+Rj1cE79hvEluiR8fHmx+p3XhtM5pCny+yeMKhvYvYcR0xT/WDmG7RDYd2qtWCnl XtEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=5WoQZXf/Qu4osArNN09Iz8PGbluQlaT3uNWmprLEih4=; b=j4e1ZgMIkjoQrmJJ/YDBRaxrtKCC/wDv7xKeF67If9YJ7z3R0I3PSSxoWL4sLI7FT1 a7nPpC/Ub+ZSryYP4TiZjLKvQ0oHrhBDLgPigkBmmMsyB7A8mmzWr34R4NdMvJafMPGl t9ANeRC+xu99jfAWznJ58P5XlO2wrHJ37xCOglk4iRdyfUcLTd2fyhO707Pws5hyi5jl VvHGVQytaOjoculqS6wq24TLlDkzCio+L2SCf+0zZYV6VMP5fVTGuwB/dyFwOTeNvUJE RBg2GQkak3zzTYvClPvApsr7JQx3yi4WW+FXpQ9NZiAY3xNwOiIO1GLVPitsLFwcs7rB 7DIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=5WoQZXf/Qu4osArNN09Iz8PGbluQlaT3uNWmprLEih4=; b=dBPRz1eVwdrGrf8lj4vDLhsyFV4//ee+OjLO0v6rnWTdwILz8k+n2Fnlu4mS1kU7Uc a1cXjHgnFPn9glBF1dxmoxoyxzm1KnqB5NUWxtN6B/kCFyC4Q6tQDYRWeq1ZN0LMXasq xlCiTYXbBS427vtHSt0etDMz1/qWxJ52NfvWJXME8vadEBvvlVAYlbTvEvZrfB53acJ/ JlfV47vK552/ci281456d5fLSxlEXLE8ijPed2MQiomy+9TamM7y+uzTzdI5ZrQ4I4ue 5GPkn5xrwnmcZscMNAA6Es9cMQKzGq53I9UDibOGlLg8BNAJl4pWFLtZIrV6abeee0hA Ptag== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krbDInNmlHrZYJ5As2wcC1WK34aTXN3KHbEaeyrA/GoALqym3Yp doUScpXE8LZz3E+DGIUWk1k= X-Google-Smtp-Source: AMrXdXuDSac4lhIj4u4JzaTdmw+3r+9RkeIwtnzHkUBIPm5I5h9W+c/6SZTgAdfzDcgGxwZV1DUMXQ== X-Received: by 2002:aca:ba44:0:b0:36e:5a28:b24 with SMTP id k65-20020acaba44000000b0036e5a280b24mr228128oif.185.1674161060461; Thu, 19 Jan 2023 12:44:20 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:d344:b0:152:e7d4:7359 with SMTP id h4-20020a056870d34400b00152e7d47359ls1159879oag.2.-pod-prod-gmail; Thu, 19 Jan 2023 12:44:17 -0800 (PST) X-Received: by 2002:a05:6870:ebc5:b0:15e:c180:db29 with SMTP id cr5-20020a056870ebc500b0015ec180db29mr1101334oab.237.1674161057422; Thu, 19 Jan 2023 12:44:17 -0800 (PST) In-Reply-To: X-Original-Sender: kingettspeaks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:32037 Archived-At: ------=_Part_2946_1188184726.1674161056671 Content-Type: multipart/alternative; boundary="----=_Part_2947_533683070.1674161056672" ------=_Part_2947_533683070.1674161056672 Content-Type: text/plain; charset="UTF-8" This has been very helpful so far! I get an error when I try and run one of your commands, though. I am trying the numbered files method, with all chapters in a folder, numbered like so. 0010-intro.md 0020-part1.md 0030-part2.md. With all the files in the directory, I run the following command. pandoc -s -o merged.odt *.md The error I get is, pandoc: *.md: withBinaryFile: invalid argument (Invalid argument) Any ideas on what could be the problem with the above? All of your other suggestions have worked so far! On Thursday, January 19, 2023 at 3:28:54 AM UTC-6 BPJ wrote: > You can just list the files on the command line as multiple inputs and > pandoc will merge them automatically: > > pandoc -o merged.ext chap-1.md chap-2.md chap-3.md > > (where .ext is .html, .pdf or whatever.) > > Tip: if the files have different names you can give them leading > zero-padded (all with the same number of digits) at the start of the file > names: > > 0010-foreword.md > 0020-introduction.md > 0030-problem.md > 0040-this.md > ... > 0070-that.md > ... > 0100-conclusions.md > > And then you should be able to just say > > pandoc -o merged.ext *.md > > and the files should be correctly ordered by the shell. > > The point of "spacing out" the numbers as I did above is that if you add > or rearrange a file you can just change its number to something > intermediate instead of renumbering all the files; e.g. if you want to move > the "that" chapter to before the "this" chapter you just rename it > 0035-that.md. I realize that e.g. in a dissertation you are not as likely > to rearrange chapters, but e.g. in documentation, where I work nowadays, it > happens with some frequency. > > I hope this is helpful. > > /bpj > > Den ons 18 jan. 2023 15:58Robert Kingett skrev: > >> I've tried to look online, for both a powershell command and a CMD >> command, possibly even a batch file, that would concatenate/merge multiple >> Markdown, .MD, files in a directory and then output it as one, merged, >> file, but nothing I've found works, so could someone point me in the right >> direction? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/8da3b66e-f14a-49d3-9b65-826df906073an%40googlegroups.com >> >> . >> > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/935e5a2c-a0cf-4afa-8303-e62db5af072cn%40googlegroups.com. ------=_Part_2947_533683070.1674161056672 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This has been very helpful so far! I get an error when I try and run o= ne of your commands, though. I am trying the numbered files method, with al= l chapters in a folder, numbered like so.

0010-i= ntro.md

0020-part1.md

0030-part2.md.

With all the files in the direct= ory, I run the following command.

pandoc -s -o m= erged.odt *.md

The error I get is,
pandoc: *.md: withBinaryFile: invalid argument (Invalid argum= ent)

Any ideas on what could be the problem with= the above? All of your other suggestions have worked so far!
On Thursday= , January 19, 2023 at 3:28:54 AM UTC-6 BPJ wrote:
You can just list th= e files on the command line as multiple inputs and pandoc will merge them a= utomatically:

pandoc -o merged= .ext chap-1.md chap-2.md chap-3.md

(where .ext is .html, .pdf or whatever.)
=
Tip: if the files have different names you can = give them leading zero-padded (all with the same number of digits) at the s= tart of the file names:

= 0010-foreword.md
0020-introduction.md
0030-problem.md
0040-this.md
...
0070-that.md
..= .
0100-conclusions.md

And then you should be able to just say

pandoc -o merged.ext *.md

and the files should be correctly o= rdered by the shell.

The= point of "spacing out" the numbers as I did above is that if you= add or rearrange a file you can just change its number to something interm= ediate instead of renumbering all the files; e.g. if you want to move the &= quot;that" chapter to before the "this" chapter you just ren= ame it 0035-that.md. I realize that e.g. in a dissertation you are not as l= ikely to rearrange chapters, but e.g. in documentation, where I work nowada= ys, it happens with some frequency.

I hope this is helpful.

/bpj

Den ons 18 jan. 2023= 15:58Robert Kingett <kinget.= ..@gmail.com> skrev:
I've tried to look online, for both a powersh= ell command and a CMD command, possibly even a batch file, that would conca= tenate/merge multiple Markdown, .MD, files in a directory and then output i= t as one, merged, file, but nothing I've found works, so could someone = point me in the right direction?

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus= ...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8= da3b66e-f14a-49d3-9b65-826df906073an%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/935e5a2c-a0cf-4afa-8303-e62db5af072cn%40googlegroups.= com.
------=_Part_2947_533683070.1674161056672-- ------=_Part_2946_1188184726.1674161056671--