"dd conv=unblock cbs=80 - really grep replacement"

Jill Diewald jad at insyte.UUCP
Thu Jun 30 03:50:35 AEST 1988


In article <10104 at tekecs.TEK.COM> andrew at frip.gwd.tek.com (Andrew Klossner) writes:
>>> Can't you just do: "dd conv=unblock cbs=80 (or whatever)" to
>>> convert the file to standard Unix \n-terminated lines?  Hasn't this been
>>> part of Unix since at least v6?
>
>> Apparently not:  neither System III nor System V r3.1 supports it.  (I used
>> "strings" on both systems, to make sure it wasn't merely undocumented).
>
>Either your "strings" is busted or you have a crippled V3.1.  The
>vanilla AT&T 3.1 source tape includes a dd.c that implements this
>command.

This is a reply to my original request for a way to use grep on
files with very long fixed record lengths.

Two things: first I am using HP-UX which does not have 'conv=block'
documented so its probably not implemented either.

More importantly, this is NOT a good solution.  (I could easily write
a c program to reformat the file if I wanted to.)  The files that
we deal with are very very large data files.  Making a reformated
copy of the file is not a good solution.  I could just as easily
(in fact this is what I usually do) execute emacs, go to lunch while 
it loads, and then use emacs to do the searches - which is easier than 
grep anyway.  Making a reformated copy 1) uses up too much disk space,
and 2) takes too long.

Ideally, grep could be passed a record size which it would use instead
of newlines.  And/Or grep could be told to only search specified columns
of every record.  This would enable me to easily deal with these files 
without tieing up either memory or disk space.

Jill Diewald
Innovative Systems 
Newton, Ma
... harvard!axiom!insyte!jad



More information about the Comp.unix.wizards mailing list