The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #6 (permalink)  
Old 10-06-2008
vijay_0209 vijay_0209 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 52
try this....tell me if this works fine.....

awk '{
if(NR%3!=0)
{
print
}
else
{
for(i=1;i<=NF;i++)
{
if(i==1)
{
printf("%s ",substr($1,2,length($1)-1))
}
else
{
printf("%s ",$i)
}
}
printf"\n"
}
}' file

Last edited by vijay_0209; 10-07-2008 at 12:09 AM..