Path: utzoo!attcan!uunet!mcsun!ukc!slxsys!ibmpcug!dylan From: dylan@ibmpcug.co.uk (Matthew Farwell) Newsgroups: comp.editors Subject: Re: vi: search for or go to a line not of length n Keywords: vi search goto uudecode Message-ID: <1990Sep25.135441.10647@ibmpcug.co.uk> Date: 25 Sep 90 13:54:41 GMT References: Reply-To: dylan@ibmpcug.CO.UK (Matthew Farwell) Organization: The IBM PC User Group, UK. Lines: 32 In article lee@chsun1.uchicago.edu (dwight lee) writes: >Most uuencoded lines are 61 characters long. I'd like to be able to search >for a line that isn't 61 characters long. Any reasonably automated method >will do! Regexps, macros... anything. I don't think theres any easy way to actually do this within vi. If you want to do this, use something like awk or perl. >Also, is there a way for a search in vi to be inverted? ie "search for the >next line which does not begin with a capital M". This would also be good for >checking on mangled uuencoded files. Using /^[^M] would do this (where ^M is ^ (carat), NOT ctrl M. This means match anything without M as the first character at the beginning of the line. If you want to do an operation on all line which match this regexp, use the ex commands :g or :v :g/^[^M]/ or :v/^M/ :v is just the opposite of :g (as in the -v option of grep) I think it would be far easier for you to sort things out in perl or awk. If you have any problems, mail me. Dylan. -- Matthew J Farwell | Email: dylan@ibmpcug.co.uk The IBM PC User Group, PO Box 360,| ...!uunet!ukc!ibmpcug!dylan Harrow HA1 4LQ England | CONNECT - Usenet Access in the UK!! Phone: +44 81-863-1191 | Sun? Don't they make coffee machines?