Re: [rfc-i] looking for a volunteer to write a simple script

Joe Touch <touch@strayalpha.com> Mon, 15 July 2019 04:55 UTC

Return-Path: <rfc-interest-bounces@rfc-editor.org>
X-Original-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Delivered-To: ietfarch-rfc-interest-archive@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B2BD3120046 for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Sun, 14 Jul 2019 21:55:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.752
X-Spam-Level:
X-Spam-Status: No, score=-4.752 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=strayalpha.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 63o0Tdc9XPOi for <ietfarch-rfc-interest-archive@ietfa.amsl.com>; Sun, 14 Jul 2019 21:55:26 -0700 (PDT)
Received: from rfc-editor.org (rfc-editor.org [4.31.198.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9748F120020 for <rfc-interest-archive-eekabaiReiB1@ietf.org>; Sun, 14 Jul 2019 21:55:26 -0700 (PDT)
Received: from rfcpa.amsl.com (localhost [IPv6:::1]) by rfc-editor.org (Postfix) with ESMTP id 431C8B81086; Sun, 14 Jul 2019 21:55:24 -0700 (PDT)
X-Original-To: rfc-interest@rfc-editor.org
Delivered-To: rfc-interest@rfc-editor.org
Received: from localhost (localhost [127.0.0.1]) by rfc-editor.org (Postfix) with ESMTP id 9ABB8B81083; Sun, 14 Jul 2019 21:55:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at rfc-editor.org
Authentication-Results: rfcpa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=strayalpha.com
Received: from rfc-editor.org ([127.0.0.1]) by localhost (rfcpa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MsDe9swbJiUI; Sun, 14 Jul 2019 21:55:21 -0700 (PDT)
Received: from server217-3.web-hosting.com (server217-3.web-hosting.com [198.54.115.226]) by rfc-editor.org (Postfix) with ESMTPS id 3D4C6B81081; Sun, 14 Jul 2019 21:55:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=strayalpha.com; s=default; h=To:References:Message-Id:Cc:Date:In-Reply-To: From:Subject:Mime-Version:Content-Type:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yx8GewH9HQLYvcqhkF1F81DAZtDGkqtwI/P6Rt3bdm8=; b=wtxqfovot5B4i35urWckmd4JY orn6HbCgoVqqNpRrWi1M9u4l29i73Yr0eTl6AiMXKbqrsWhVDrRldifrJx4zBmPc7dngebkpkcFxL eXCWGhciKN85KTN9Mi6skP6X2B6w0+V9B/c6XMZrCRoR5fbHgvYDkXw2HJyw+FKPKwLW58iqe8ii+ eZ1dORrNpwxJbR9i5I3C13kvr2H71iGG9j/sGNiLqyy66bpAeTXtuMAgSFL1/Gtx2RV+Q1kD6naAn OqCW+88qom6DCkJx7hNPCk8Bd3SkVzNfM9TYXc6G1kfeH7Yon61ijH/jG2NCHFKj/9UJJqr68YROt foouaMmUw==;
Received: from cpe-172-250-225-198.socal.res.rr.com ([172.250.225.198]:63867 helo=[192.168.1.10]) by server217.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <touch@strayalpha.com>) id 1hmt1B-003Q75-Lp; Mon, 15 Jul 2019 00:55:22 -0400
Content-Type: multipart/mixed; boundary="Apple-Mail=_587C20DF-AE5F-4D7C-95AA-6A83CCDE8FB4"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Joe Touch <touch@strayalpha.com>
In-Reply-To: <5B9EE844-B13E-419C-9A57-8D10F9AC7BE0@rfc-editor.org>
Date: Sun, 14 Jul 2019 21:55:13 -0700
Message-Id: <F75E7007-20C4-411A-901E-D2A951564543@strayalpha.com>
References: <62c8413d-c735-4ec3-8b22-eb0fa5356636@Spark> <38d0704f-348c-4ec0-9d94-340747960201@Spark> <e86b8894-4d7a-4c9d-3476-0221a94c9eb0@gmx.de> <13A89BE6-8654-49C4-9FBA-2F709EE0BA1B@rfc-editor.org> <0504f606252c476f66804e338fa460b4@strayalpha.com> <c23139a7261e58cbfc93ac18a3815bad@strayalpha.com> <01ADB89D-90AF-4672-A8B9-54F5B09E82D4@amsl.com> <176910E2-56E1-4B3B-8510-797C3560E90A@strayalpha.com> <116BAD01-3331-4D9F-A3DA-D3B2C58B7ED0@strayalpha.com> <5B9EE844-B13E-419C-9A57-8D10F9AC7BE0@rfc-editor.org>
To: Heather Flanagan <rse@rfc-editor.org>
X-Mailer: Apple Mail (2.3445.9.1)
X-OutGoing-Spam-Status: No, score=-1.0
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server217.web-hosting.com
X-AntiAbuse: Original Domain - rfc-editor.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - strayalpha.com
X-Get-Message-Sender-Via: server217.web-hosting.com: authenticated_id: touch@strayalpha.com
X-Authenticated-Sender: server217.web-hosting.com: touch@strayalpha.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Subject: Re: [rfc-i] looking for a volunteer to write a simple script
X-BeenThere: rfc-interest@rfc-editor.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the RFC series and RFC Editor functions." <rfc-interest.rfc-editor.org>
List-Unsubscribe: <https://www.rfc-editor.org/mailman/options/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=unsubscribe>
List-Archive: <http://www.rfc-editor.org/pipermail/rfc-interest/>
List-Post: <mailto:rfc-interest@rfc-editor.org>
List-Help: <mailto:rfc-interest-request@rfc-editor.org?subject=help>
List-Subscribe: <https://www.rfc-editor.org/mailman/listinfo/rfc-interest>, <mailto:rfc-interest-request@rfc-editor.org?subject=subscribe>
Cc: RFC Interest <rfc-interest@rfc-editor.org>
Errors-To: rfc-interest-bounces@rfc-editor.org
Sender: rfc-interest <rfc-interest-bounces@rfc-editor.org>

Hi, Heather,

There are two solutions, attached. They both avoid duplicate insertion of the tags, but ONLY if the tags were used adjacent to the keywords with only whitespace between.

simple-bcp-fix.pl
	runs on any version of perl5
	does a simple search and replace that may create duplicates if <bcp14> tags are already in use
	but then removes duplicates *if they are separated only by whitespace*

lookback-bcp-fix.pl
	runs only on perl 5.30.0 and later, using an experimental feature “variable lookback"
	inserts tags if the tag isn’t immediately preceding, separated by up to 248 chars of whitespace
	no need to remove duplicates

you can test which version of perl you’re running using “perl -v”. if it’s 5.30.0 or later, either version will run. If lower than 5.30.0, then only the first (simple-bop-fix) will work.

to run, use it this way (e.g., for using simple-bcp-fix.pl):

	perl simple-bcp-fix.pl INFILE.xml > OUTFILE.xml

to modify files in-place, use:

	perl -i simple-bcp-fix.pl INFILE.xml

Joe


      
          

_______________________________________________
rfc-interest mailing list
rfc-interest@rfc-editor.org
https://www.rfc-editor.org/mailman/listinfo/rfc-interest