Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!usenet.stanford.edu!not-for-mail From: xyz2041 Newsgroups: gnu.utils.bug Subject: Re: Just want to exclude lines with tabs Date: Thu, 19 May 2016 22:19:45 -0500 Lines: 40 Approved: bug-gnu-utils@gnu.org Message-ID: References: <201605192121.u4JLLI4b005478@freefriends.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: usenet.stanford.edu 1463714392 14957 208.118.235.17 (20 May 2016 03:19:52 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-gnu-utils@gnu.org To: Karl Berry Envelope-to: bug-gnu-utils@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=exz5BBnmi2izKl3QpFkP+9bD8rQz67EGyrTxfxsGHVM=; b=xrsqGPbYzdVjOW/M3vCG8fcBAsvD59Bb2n3V1vpnNH1YAfNLVbwlrhdSMBP1N8wIY6 s0IMZnRCjxj6Ad3yShKGg8WQQRwsCutEmnXV2Uv6K6A3l0XJ9P1d9NmwFW6qAeKUCBhg f3GPoyvNbjgxgTmcAs66BU6S55ZmbHofC1WNe/K5BJZpC4kss0PQERvtl79gPjN3D0ha WDlJwcxOi0x+IUD5PbDP4ccJSDlz/V9vm+J0w8vnqXwxfmwTR4lv9TCjYg+p2GAfcBUd KETxihmXwmbeDlpiVJZccGRzSAtDTRoefF6oRf/kr4yqlI+OjZ+yMClNYMcFXuZ+MV+x 811g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=exz5BBnmi2izKl3QpFkP+9bD8rQz67EGyrTxfxsGHVM=; b=CDRN7RnJowIfZLI2cQUFQ57atTIOW1YMjQ5oy4+urBJ3POORsvySM+qdj5c28iX0v1 qMPL8L57paBrwjgpnlQW0+BfZkdwi2LJfynYhyySKy1O0jOBM1wAzM6VWYAeE+vaR6b5 q1IKzGcnoDaQyaDhQ9viqz8UP71SwnW3WmIoAi+DNRUVjOUMj2Rmd31E4iD8QEyzo0Hl O6grhPmz3/x3i3MWYqhEnUvXURFWlNihykLgRXeAGto7G1bt8hnULa6gHAbpTUrmNlPN bKnmHo4DvIK6IyZ/RxKqKUqtZbiAfR+pIK+qJwiP1f19sjNeZEERBj7Rge+nD7EQyG4K 2MQQ== X-Gm-Message-State: AOPr4FWhtocfeUtwXyUVS16RI52vyktLUI6Fj6PK0IWvwQluP/v9lPpYzQ1gInfX+wXaqfdBCDiJInSnLh61qA== X-Received: by 10.176.6.168 with SMTP id g37mr437181uag.34.1463714385805; Thu, 19 May 2016 20:19:45 -0700 (PDT) In-Reply-To: <201605192121.u4JLLI4b005478@freefriends.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::230 X-BeenThere: bug-gnu-utils@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.utils.bug:2211 Thanks, everyone. I just couldn't get Windows command line to let me put a tab on the line, so I wrote a batch file: set TAB= grep -v "%TAB%" %1.%2 > %1-NoTabs.csv grep -v "," %1.%2 > %1-NoCmas.tab Just hit the tab key after "set TAB=". Not elegant but it works. grep version: K:\>grep -V grep (GNU grep) 2.5.1 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MD5: bb350a9ac2236b3e29f2229e77709f40 Thanks, again! On 5/19/16, Karl Berry wrote: > grep "$(printf '\t')" o.csv > > It seems to me this should have worked, unless your shell's quoting got > rid of the \ before printf could see it. Certainly this works: > > tab=`printf '\t'` # or $(...), whatever > grep "$tab" somefile > > This assignment of special characters to shell variables and then using > the variable in subsequent commands is the most portable (across decades > and "improvements" in standards, shells, systems, ...) approach I know > of. FWIW. -k > >