Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] find lines in text file by length
Date: Sat, 29 Jan 2011 15:28:01
Message-Id: 201101291525.p0TFPmf2018910@dcnode-01.unlimitedmail.net
In Reply to: Re: [gentoo-user] [OT] find lines in text file by length by Etaoin Shrdlu
1 On Sat, 29 Jan 2011 14:57:28 +0000
2 Etaoin Shrdlu <shrdlu@×××××××××××××.org> wrote:
3
4 > On Sat, 29 Jan 2011 10:01:02 -0500
5 > Willie Wong <wwong@××××××××××××××.EDU> wrote:
6 >
7 > > This is way OT, but I hope someone here can give me a quick answer:
8 > >
9 > > I have a text-file. Individual lines of it run from 10 to several
10 > > thousand characters in length. Is there a simple* command that allows
11 > > me to only display the lines that are, say, at least 300 characters
12 > > long?
13 >
14 > awk 'length >= 300' file
15 >
16 > sed -n '/.\{300\}/p' file
17
18 Oh, and obviously
19
20 grep '.\{300\}' file
21
22 perl -ne 'print if /.{300}/' file

Replies

Subject Author
Re: [gentoo-user] [OT] find lines in text file by length Willie Wong <wwong@××××××××××××××.EDU>