Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!olivea!oliveb!felix!asylvain@felix.UUCP From: asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain) Newsgroups: comp.editors Subject: Re: Change cases in VI Message-ID: <155015@felix.UUCP> Date: 21 Dec 90 17:27:02 GMT References: <1990Dec11.011804.14702@pa.dec.com> Sender: daemon@felix.UUCP Reply-To: asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain) Distribution: na Organization: FileNet Corp., Costa Mesa, CA Lines: 40 In article <1990Dec11.011804.14702@pa.dec.com> reader@wsl.dec.com (News Reader) writes: > > Is there an easy way to change the whole file from upper case to lower case or > vice versa? I don't want to do 26 substitutions to change character by > character. > IS THERE AN EASY WAY TO CHANGE THE WHOLE FILE FROM UPPER CASE TO LOWER CASE OR VICE VERSA? I DON'T WANT TO DO 26 SUBSTITUTIONS TO CHANGE CHARACTER BY CHARACTER. Hmm, yes, I believe there is! Just a combinations of solutions I've seen. To up-case a single paragraph, you can type: {!}tr '[a-z]' '[A-Z]' which will conveniently pipe the paragraph into the tr (translate) command. To translate the entire file, set your cursor at the beginning and enter: !Gtr '[a-z]' '[A-Z]' I've just learned of this method, deduced from the '{!}fmt' command I've read in these postings. This is an amazingly powerful feature! If there's nearly anything at all you want to do from the editor that it doesn't do now, just write it in C and there it is! Altho, it's extremely likely there's a utility, such as 'fmt', which already does it. In fact, I'm thinking of writing my own version of 'fmt' that will take hyphens into account, plus auto-hyphening common suffixes and prefixes. So that you'd change, for example, "hyphening" to "hyphen- ing", and back, as required. Or does *that* already exist somewhere, too? -- asylvain@felix.UUCP (Alvin "the Chipmunk" Sylvain) ========================= Opinions are Mine, Typos belong to /usr/ucb/vi "We're sorry, but the reality you have dialed is no longer in service. Please check the value of pi, or see your SysOp for assistance." UUCP: hplabs!felix!asylvain ============================================