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:17:34
Message-Id: 201101291515.p0TFF5h8011321@dcnode-01.unlimitedmail.net
In Reply to: [gentoo-user] [OT] find lines in text file by length by Willie Wong
1 On Sat, 29 Jan 2011 10:01:02 -0500
2 Willie Wong <wwong@××××××××××××××.EDU> wrote:
3
4 > This is way OT, but I hope someone here can give me a quick answer:
5 >
6 > I have a text-file. Individual lines of it run from 10 to several
7 > thousand characters in length. Is there a simple* command that allows
8 > me to only display the lines that are, say, at least 300 characters
9 > long?
10
11 awk 'length >= 300' file
12
13 sed -n '/.\{300\}/p' file

Replies

Subject Author
Re: [gentoo-user] [OT] find lines in text file by length Etaoin Shrdlu <shrdlu@×××××××××××××.org>