home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10676 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  691 b 

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!karell
  2. From: karell@cs.Helsinki.FI (Esa Karell)
  3. Newsgroups: comp.unix.questions
  4. Subject: awk with columns
  5. Message-ID: <29098@hydra.Helsinki.FI>
  6. Date: 3 Sep 92 06:30:46 GMT
  7. Organization: University of Helsinki, Finland
  8. Lines: 23
  9.  
  10. Could someone tell me what would be the easisest
  11. way to accomplish this with awk.
  12.  
  13. Input:
  14.  
  15. X    Y  T        P I
  16. 1    2  3        4 5
  17. .    .  .        . .
  18.  
  19. I'd need to swap the values of Y & T so output should look:
  20.  
  21. X    Y  T        P I
  22. 1    3  2        4 5
  23. .    .  .        . .
  24.  
  25. All the blanks between the columns should remain the same.
  26. Thx,
  27.  
  28. Esa
  29. -- 
  30.  
  31. Esa Karell karell@cs.Helsinki.FI
  32. Tel. +358-0 513 081          
  33.