On Sat, Jan 29, 2011 at 5:01 PM, Willie Wong <ww...@math.princeton.edu> wrote: > This is way OT, but I hope someone here can give me a quick answer: > > I have a text-file. Individual lines of it run from 10 to several > thousand characters in length. Is there a simple* command that allows > me to only display the lines that are, say, at least 300 characters > long? > > Thanks in advance, > > W > > > * simple of course includes appropriate incantations of sed/awk/perl/etc > -- > Willie W. Wong ww...@math.princeton.edu > Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire > et vice versa ~~~ I. Newton > > Hi,
Try something like sed '/\w\{300,\}/!d' file This should give you lines that have more than 300 word like characters. If you put number after "," you may define the max number. and you can change \w to match your needs => . . Best regards Petri