From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/15216 Path: news.gmane.org!not-for-mail From: Phil Cuddy Newsgroups: gmane.text.pandoc Subject: Re: Insert filename Date: Sat, 2 Jul 2016 13:41:51 -0700 (PDT) Message-ID: References: <9a6af4c5-82ff-4de6-b7a5-64bc742c586c@googlegroups.com> <20160620180721.GB94282@MacBook-Air-2.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_10040_1085291747.1467492111752" X-Trace: ger.gmane.org 1467492121 8286 80.91.229.3 (2 Jul 2016 20:42:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Jul 2016 20:42:01 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD35LLGIUENBBEGO4C5QKGQEZIQWESI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jul 02 22:41:57 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf0-f184.google.com ([209.85.192.184]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bJRjd-0002qr-N8 for gtp-pandoc-discuss@m.gmane.org; Sat, 02 Jul 2016 22:41:53 +0200 Original-Received: by mail-pf0-f184.google.com with SMTP id g62sf44645901pfb.1 for ; Sat, 02 Jul 2016 13:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=l25Ue2y270O6T9fm6bw91veFkmkHZqBbdEY77xsC/0w=; b=TF8QOCD5hfu6ngKPB5uhSSaWLV4n5z97kEY7WprHqh7P9gA3Y2+KNlkFb+hqr0GgQR woMEqV9qVsNcI/JiwLBnsFcz62UqxzOHphrplrkM0JxIuVAgnO2JCmyBhuw3qOuJwY1M 5TVLZ3GQLwd795YJ+r4zbRm3sprS02LV+38W6oUfyEArg6moChdtpZnnYLmw38gkYSNh KxCJhTTJLuwpBhmKKLsWglPMI+EHorVJwP4waMLtYmRy4KRVukL1xbzdXGUW88PPT+Xy /kq1zaF/Ch0Ijclb7p58VYKDC1TMAAopX1218Utp82jNy3LFhOCVmf4MEj5zjk+ZAPiH GVAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=l25Ue2y270O6T9fm6bw91veFkmkHZqBbdEY77xsC/0w=; b=Pz1NOVrRkkNruXnpB+hT6BqKwCJ2MBbHRJFM7jxg8iO2XFKr4XLJjca/Bj5X0ApWuE GKBaQCeBQqisM16cgYKBPdje+h7XB0MlL6Kn6/JGdL53BzP2wpTEjqUUO5ZYtheCJcMQ R5YD6B6bLOkVe5amuTVes/T5HQmf1De3wJdWEC5bWc09cVSiRhuE3Ew2QsJXm0JYect+ CCldy2Uuu3B06lIvyANluYzEXo/nfHwa1KtxKFj4QNz1aVjj0oU2CGFofd2yrKLRqGFW cREQFn1/mzDBgWbbnrIubJsTgtN1hC3Gcjz3m0FcoDjO8ELoKign85nkV/hUn2bbEKSY mEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=l25Ue2y270O6T9fm6bw91veFkmkHZqBbdEY77xsC/0w=; b=Vap92+fkungZhoyUM1bjc6xRnlc4RRf/uUhCS+Br7FAQPvHPKP7sq7Ro85MbWca8Wn fj71yz740l5MKPKaTu3y1ym00gJlo6Vad/Qu1mKzKm7rp6zKSNmDKYTVJlyo/Kixa7ZZ Zryv4zeX3qPvaIItyCZatlOsXnl4jYFsDwsB3A0gT8IYtd4iltns6lSUnFfJVQabAi53 R5gMs1KXjvB14iFtYhb4RRNeOFPGNn+e9IE4jLmtkdD8GY2scHdhYTIPeH2HC9U09s6S y1AOvS+0gs81vff/Vhu3F0sdhNYU45Y0xjpcEDRHodSUhB5s0CCdOJctavpS5avfOMmv glVA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ALyK8tKi20sm2x8EG35FI+zmPvOqsfIEngL5uidHkO4UP1xwae53MAV6Jw9xn7PyaqsSqA== X-Received: by 10.157.43.150 with SMTP id u22mr1090897ota.17.1467492112633; Sat, 02 Jul 2016 13:41:52 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.11.195 with SMTP id 61ls257447oth.19.gmail; Sat, 02 Jul 2016 13:41:52 -0700 (PDT) X-Received: by 10.157.9.102 with SMTP id 93mr1091691otp.8.1467492112170; Sat, 02 Jul 2016 13:41:52 -0700 (PDT) In-Reply-To: X-Original-Sender: philcuddy-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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:15216 Archived-At: ------=_Part_10040_1085291747.1467492111752 Content-Type: multipart/alternative; boundary="----=_Part_10041_1074401416.1467492111752" ------=_Part_10041_1074401416.1467492111752 Content-Type: text/plain; charset=UTF-8 Thanks Daniel, how would i amend that to add a blank line below the inserted header? On Tuesday, 21 June 2016 19:49:21 UTC+1, daniel wrote: > > On 2016-06-21 12:26, Phil Cuddy wrote: > > Hi, i have found the following perl script that party does what i > > want, (insert the filename in each text file), but it fails if there > > are spaces in the filename. Any ideas on how to amend? > > > > perl -i -pe 'BEGIN{undef $/;} s/^/$ARGV\n/' `find . -name '*.txt'` > > > > Try: > > find . -name '*.txt' -exec perl -i -pe 'BEGIN{undef $/;} s/^/$ARGV\n/' > {} \; > > This is really a combo shell/perl script. It could probably be done in > just Perl as well, but this was easy enough. ;) > > Daniel T. Staal > > --------------------------------------------------------------- > This email copyright the author. Unless otherwise noted, you > are expressly allowed to retransmit, quote, or otherwise use > the contents for non-commercial purposes. This copyright will > expire 5 years after the author's death, or in 30 years, > whichever is longer, unless such a period is in excess of > local copyright law. > --------------------------------------------------------------- > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f19553de-1059-426a-a270-0470f897675b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_10041_1074401416.1467492111752 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Daniel, how would i amend that to add a blank line = below the inserted header?

On Tuesday, 21 June 2016 19:49:21 UTC+1, = daniel wrote:
On 2016-06-21 12= :26, Phil Cuddy wrote:
> Hi, i have found the following perl script that party does what i
> want, (insert the filename in each text file), but it fails if the= re
> are spaces in the filename. Any ideas on how to amend?
>=20
> perl -i -pe 'BEGIN{undef $/;} s/^/$ARGV\n/' `find . -name = '*.txt'`
>=20

Try:

find . -name '*.txt' -exec perl -i -pe 'BEGIN{undef $/;} s/= ^/$ARGV\n/'=20
{} \;

This is really a combo shell/perl script. =C2=A0It could probably be do= ne in=20
just Perl as well, but this was easy enough. =C2=A0;)

Daniel T. Staal

-------------------------------------------------------------= --
This email copyright the author. =C2=A0Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. =C2=A0This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
-------------------------------------------------------------= --

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/f19553de-1059-426a-a270-0470f897675b%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_10041_1074401416.1467492111752-- ------=_Part_10040_1085291747.1467492111752--