delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/23/11:16:45

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
q=dns; s=default; b=Cij2PBm4Hyj7lbPbmwTfjD3CvCuJR+zfFTvhM6Ka+lF
9Q+pJBrpu/I7stjI80loGxB1WgIpWG/31XywcjLz3zON+yaQt56x7ycWFnlt/IOx
8l87POUyaYSi9FgF23Ecee3QMMoiZ9UpTkpDkbnz+cKbU7ijiDDtIq/p7ooLVqkY
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
s=default; bh=o2jaJ4YDkip4N0XpyoWnuUwa5UE=; b=KgRjKxs8dPMKQAP9c
qbWH1j6/u3dpBrmJIve5WlYZ3aLspyAAW+PlfeDFx3bTOyG6DttVSubGOU8vxxOu
SQs/xVYRo4mCetBqwzYUrbaOD0PBzi93bRvMX0D4TZTGz7XjNIHvCOa+Ks9gXBwe
rJkMO4qXWiEKOOLzMth25jQGk4=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Eliot, Moss, moss, eliot
X-HELO: resqmta-po-02v.sys.comcast.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1563894943; bh=KuUsi1m8jLVVL1eCmLyfejuBDoFdtB7Yi5s/Vlsb7/A=; h=Received:Received:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; b=4KKVZI4JwWnaJ0L5T+I61Somdt5a5DrJvOPpZUSRUQoomU6oaobSGLQSBQZJnCUYb D7G2a9yFaOx6xoL/WjrV1AKA0xjgvKRwBeDb29iiRxqPnQWrn1KAYUZJzv7jJlQWyT 7jJ2lGkAN2LoJvnU8xJkRNQIFbOlC/jZDq1WKA1NbhGUCJYFNmBC4pT/ac/5Lpix+R 9KhsJbG6Wboj7sZnVClF9sqMLw3NlN9O/ydQ3BDULs+y9GBD5ZTx4xvptau5pAef2u D45Yrb/2WyTBrvXu13BMOfi5ZRqKKvGK5DN5spBHB0O+XDQ42UXZ6FPxEYDJTYmY5J 19HcHe2dwAx6w==
X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgeduvddrjeekgdekjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvfhgjufffkfggtgfgofhtsehtjehgtddvtdejnecuhfhrohhmpedftehnugihucfjrghllhdfuceofhhigihpvghrthhishgvqdgtohhnshhulhhtihhnghestghomhgtrghsthdrnhgvtheqnecukfhppeejfedrvddvfedrjeegrddvleenucfrrghrrghmpehhvghloheptehnugihhghorhhkpdhinhgvthepjeefrddvvdefrdejgedrvdelpdhmrghilhhfrhhomhepfhhigihpvghrthhishgvqdgtohhnshhulhhtihhnghestghomhgtrghsthdrnhgvthdprhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhmpdhrtghpthhtohepmhhoshhssegtshdruhhmrghsshdrvgguuhenucevlhhushhtvghrufhiiigvpedt
X-Xfinity-VMeta: sc=0;st=legit
From: "Andy Hall" <fixpertise-consulting AT comcast DOT net>
To: <moss AT cs DOT umass DOT edu>, <cygwin AT cygwin DOT com>
References: <009e01d540c6$c1b11d50$451357f0$@comcast.net> <ac58e313-bfbf-b245-6c80-58d59be23f47 AT cs DOT umass DOT edu>
In-Reply-To: <ac58e313-bfbf-b245-6c80-58d59be23f47@cs.umass.edu>
Subject: RE: Join command fails to output fields on input file with DOS line endings.
Date: Tue, 23 Jul 2019 08:15:41 -0700
Message-ID: <00a301d54169$7e0a3f70$7a1ebe50$@comcast.net>
MIME-Version: 1.0
X-IsSubscribed: yes

> On 7/22/2019 12:59 PM, Eliot Moss wrote:
> On 7/22/2019 12:50 PM, Andy Hall wrote:
> > This behavior of join surprised me:
> >
> > $ join -1 3 <(echo a b col3  c d | unix2dos) <(echo col3 f2 f3 f4 f5)
> >   f2 f3 f4 f5
> >
> > Join parses the input line well enough to execute the join, but the presence of the DOS line endings suppresses the
> > output of fields from the first input.
> >
> > Compare with
> >
> > $ join -1 3 <(echo a b col3  c d) <(echo col3 f2 f3 f4 f5)
> > col3 a b c d f2 f3 f4 f5
> >
> > which is correct.
> >
> > Here is a weirder example where the join field is missing and the output is reversed!
> >
> > NOK
> > $ join <(echo col F1 | unix2dos) <(echo col F2)
> >   F2 F1
> >
> > OK
> > $ join <(echo col F1) <(echo col F2)
> > col F1 F2
> 
> The lesson is: You're better off not using DOS line endings with Cygwin.
> It tends to do things the POSIX way, where the line ending is LF, not
> CR LF.  Some things *may* work, but it's somewhat hit or miss ...  EM
> 
Right.  But in this case,  the last field of the first file contains a \r which
completely mangles the output.  

But join appears to "work" if the lines of the second file are in DOS format.

E.g.
$ join <(echo col F1) <(echo col F2 | unix2dos)
col F1 F2


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019