The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 10-03-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,434
Quote:
Originally Posted by krishna.fuji View Post
and important is this script should touch only the line which are having combination of Personal Unit,Plant,Department in a single line
Forget about fancy colors, and use code tags when you post code or data.

Code:
awk -F, '{if(/Personal Unit/&&/Plant/&&/Departmant/){printf "# %s\n%s\n%s\n%s\n",$0,$1,$2,$3}else{print}}' file