home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16522 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  994 b 

  1. Path: sparky!uunet!wupost!spool.mu.edu!olivea!sgigate!odin!sam.wpd.sgi.com!pj
  2. From: pj@sam.wpd.sgi.com (Paul Jackson)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Nawk Balks again
  5. Message-ID: <1992Nov17.024412.1607@odin.corp.sgi.com>
  6. Date: 17 Nov 92 02:44:12 GMT
  7. References: <34092@adm.brl.mil>
  8. Sender: news@odin.corp.sgi.com (Net News)
  9. Reply-To: pj@sgi.com
  10. Organization: Silicon Graphics, Research & Development
  11. Lines: 19
  12. Nntp-Posting-Host: sam.wpd.sgi.com
  13.  
  14. In article <34092@adm.brl.mil>, karron@karron.med.nyu.edu (Dan Karron (karron@nyu.edu)) writes:
  15. |> 
  16. |> More nawk bugs. Try this. Note that the 
  17. |> string should contain the string value of "001", not "".
  18. |>
  19. |>      i = 1; ...
  20. |>       sprintf(string,"%03d",i);
  21. |>       print "string=",string
  22.  
  23. I think you're missusing sprintf.  The following works, and
  24. follows the sprintf usage explained in the AWK book:
  25.  
  26.     string=sprintf("%03d",i);
  27.  
  28. -- 
  29.  
  30.                 I won't rest till it's the best ...
  31.                 Software Production Engineer
  32.                 Paul Jackson (pj@sgi.com), x1373
  33.