Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!wesommer From: wesommer@athena.mit.edu (William Sommerfeld) Newsgroups: comp.unix.wizards Subject: Re: grep replacement Keywords: Long Lines Message-ID: <5742@bloom-beacon.MIT.EDU> Date: 12 Jun 88 08:17:26 GMT References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> <2312@bgsuvax.UUCP> <7869@ncoast.UUCP> <144@insyte.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: wesommer@athena.mit.edu (William Sommerfeld) Organization: Massachusetts Institute of Technology Lines: 27 In article <144@insyte.UUCP> jad@insyte.UUCP writes: >A missing feature in UNIX is the ability to deal with files with >very long lines - the kind of file you get from a data base tape like >Compustat. The standard data base tape contains very long lines. >Instead of separating each record with a newline, all the records may >be on the same line. There is a defined record size which is used to >determine when a record ends - instead of a newline. > >There are two specific things that it would be nice to do with UNIX, >instead of having to write a c program: As usual with UNIX, you _don't_ have to write a C program. Use `dd' instead. If we're talking about the canonical IBM "80 column card image", then the following should work just fine to convert it to a "normal" file: dd conv=unblock cbs=80 out Adding conv=ascii will also convert EBCDIC into ascii. >2) To be able to specify a field range (ie columns 20-30) for the >program to search - instead of the entire line/record. grep '^........foo' picks up any line which has `foo' in columns 9-11.. - Bill