Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!brutus.cs.uiuc.edu!rpi!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: comp.unix.questions Subject: Re: transposing data {awk?} Message-ID: <256C6379.6EB2@rpi.edu> Date: 23 Nov 89 21:39:04 GMT References: <4473@netcom.UUCP> Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 16 In <4473@netcom.UUCP> beaulieu@netcom.UUCP (Bob Beaulieu) writes: Bob> Is it possible to use awk to change the 7th field of "YYMMDD" to Bob> show "MM/DD/YY" by using the awk command? Sure; in fact, it's trivial. Please try and get a hold of any basic AWK reference manual; even the crummy SunOS manual page for awk makes mention of the features you need. You'll probably end up with something like this: awk '{ $7 = sprintf("%s/%s/%s",substr($7,2,2),substr($7,4,2),substr($7,0,2));\ print; }' Dave -- (setq mail '("tale@pawl.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))