home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10393 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.0 KB

  1. Path: sparky!uunet!wupost!darwin.sura.net!haven.umd.edu!mimsy!afterlife!adm!news
  2. From: CHUCK@bkmain.poly-east-london.ac.uk (Chuck Foster)
  3. Newsgroups: comp.unix.questions
  4. Subject: awk problems
  5. Message-ID: <32213@adm.brl.mil>
  6. Date: 26 Aug 92 14:26:36 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 14
  9.  
  10. Is there any way to convert a string to lowercase/uppercase in awk scripts?
  11. I've tried   x = strupr($1);  but this just seems to return a string as is.
  12.  
  13. Also, is it possible to find the offset of a token in the whole string? The
  14. file I am operating upon is in fixed format, and a user's full name occurs
  15. after column 68, for example. At the moment I have a small  for  loop that
  16. copies each token into a variable:
  17.     for (i = 8; i <= NF; i+=1) { name = name " " $i; }
  18. but it would be nice to be able to extract the whole part from within $0 into
  19. a variable, for example, or to be able to concat a range of tokens together
  20. (in a similar why to   $(3 .. $NF)  or something.
  21.  
  22. Forgive my ignorance; I've only just begun to experiment with this
  23. interesting command ... :-)
  24.