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 -->
  #2 (permalink)  
Old 05-05-2008
penchal_boddu penchal_boddu is offline
Registered User
 

Join Date: Apr 2008
Location: Bangalore
Posts: 120
Hi,

echo "U | U|1999-01-01 |000004384|000002192|0000000000000000.0000|0000000000000000.0000| U|XXX|0000000000000685.5800| FIXED |U" | sed -e 's/| */|/g' -e 's/ *|/|/g' -e 's/|00*/|/g' -e 's/|\./|0\./g'

Output:

U|U|1999-01-01|4384|2192|0.0000|0.0000|U|XXX|685.5800|FIXED|U

Thanks
Penchal
Reply With Quote