Path: utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsl!moss!wtr From: wtr@moss.ATT.COM (3673,ATTT) Newsgroups: comp.os.minix Subject: Re: cut.c Message-ID: <3615@cbnewsl.ATT.COM> Date: 12 Jan 90 14:16:34 GMT References: <5067@ast.cs.vu.nl> <18787@bcsaic.UUCP> Sender: nntp@cbnewsl.ATT.COM Reply-To: wtr@moss.ATT.COM (Bill Rankin) Organization: AT&T Bell Laboratories Lines: 41 In article <18787@bcsaic.UUCP> paula@bcsaic.UUCP (Paul Allen) writes: >In article <5067@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes: >> >>I treid using cut yesterday to extract the third column from a crc listing >>like this: >> >>65261 8510 alloc.c >>09176 7432 break.c >>53152 990 const.h >> >>I could not find any combination of -d and -i flags to convince it to consider >>a run of spaces as a separator. I eventually did it with columns, but I >>think it ought to work with fields as well. Does anyone (e.g., the author) >>know how to do this? > >My experience with cut(1) on Suns and Ultrix is that a run of delimiter >characters is always a series of empty fields. ... >Does the System V cut(1) have an >option to treat runs of delimiters as a single delimiter? >Paul Allen Nope. SysV behaves the same way. (At least our SysVr3.1 Vaxen do) A method to get around this problem is to use tr(1) to remove all double spaces: cat file | tr -s ' ' ' ' | cut -d' ' -f???? Sorry, but I don't have a minix system in front of me, and have only played with one briefly. Does minix have tr(1)? Hope this helps, -bill. -- ===================================================================== Bill Rankin email address: att!moss!wtr was: Bell Labs, Whippany NJ att!bromo!wtr now: AT&T Federal Systems, Burlington NC (919) 228 3673 (cornet 291)