The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-21-2009
preethgideon preethgideon is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 71
I guess AWK should do it. If the fields are fixed then just print them.
Something like this

echo "<log4j:event.........schema="LMS">" | awk '{ print $3,$4, substr($5,3,5), $5...'}
Here $3, $4 prints te whole word/field and substr($5,3,5) prints 5 characters of 5th field starting from the 3rd letter.

Modify the awk with your requirements.

Thanks and Regards,
Gideon.