Sunday, November 1, 2009

View or Remove NULL values in UNIX

There may be some cases , when source files do bring junk values such as NULL(\0). Inorder to view these files , use od - octal dump.
example:
grep "353A3367FECD4D4A" /cba_app/FIP/DEV0/temp/SWIFT_GDW_EXTRACT_20091002_nonull.dly head -2 od -c more
------------------
In oder to remove these charecters , use the following command
sed 's/\x0//g' /cba_app/FIP/DEV/inbound/SWIFT/SWIFT_GDW_EXTRACT_20091002.dly > /cba_app/FIP/DEV0/temp/SWIFT_GDW_EXTRACT_20091002_nonull.dly

Using TEXT PAD ,these charecters can be viewed

No comments: