Re: How to remove nulls from a file
From: John DuBois (spcecdt_at_armory.com)
Date: 01/27/05
- Next message: Kevin Rodgers: "Re: How to remove nulls from a file"
- Previous message: glenns_at_chartermi.net: "How to remove nulls from a file"
- In reply to: glenns_at_chartermi.net: "How to remove nulls from a file"
- Next in thread: Kevin Rodgers: "Re: How to remove nulls from a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Jan 2005 22:43:34 GMT
In article <1106859286.522130.287300@c13g2000cwb.googlegroups.com>,
<glenns@chartermi.net> wrote:
>Hello,
>Backgound - Unix Version - HPUX-11
>
>I receive product order files from a customer and noticed they seemed
>quite large in size.
>If I open them with "vi", I see the following at the bottom of the
>screen...
>
>"customer_data.inb " 860 lines, 22876 characters (65187 nulls)
>
>However, If I write the file back out to disk (w!) and re-open it, the
>(65187 nulls) message is gone !
>
>My question...
>Is there a Unix command I can run (tr, awk, etc.) to simulate what vi
>did when I wrote the file back out to disk?
tr -d '\0' < infile > outfile
(the original 'tr' does this w/o requiring the -d '\0', but this version will
work with both)
> What would I replace the
>'nulls' with ?
Nothing, if you want the same effect as open/writing with vi.
Presumably you have determined that the datafiles contain all the information
you need even after the nulls have been removed, though this seems a bit odd.
John
-- John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/
- Next message: Kevin Rodgers: "Re: How to remove nulls from a file"
- Previous message: glenns_at_chartermi.net: "How to remove nulls from a file"
- In reply to: glenns_at_chartermi.net: "How to remove nulls from a file"
- Next in thread: Kevin Rodgers: "Re: How to remove nulls from a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|