The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-05-2008
mohan705 mohan705 is offline
Registered User
 

Join Date: Feb 2007
Posts: 91
Trimmng leading 0's from amount fields

Hi


I need to remove leading zeros if that filed is amount filed and trimmimg leading and trailing spaces


U | U|1999-01-01|000004384|000002192|0000000000000000.0000|0000000000000000.0000| U|XXX|0000000000000685.5800| FIXED |U



Tried with this command ,I am not getting expected o/p

sed -e 's/ *|/|/g' -e 's/[ ]*^//g' -e 's/|00*\/|0\./g' file

o/p

U|U|1999-01-01|000004384|000002192|0.0000|0.0000|U|XXX|685.5800|FIXED|U


Thanks in advance
Mohan
Reply With Quote
Forum Sponsor