Removing magic numbers

Alan Jackson ajackson
Mon May 17 12:02:19 PDT 2004


Ahhh.... I knew there had to be a way to do it with sed, but I forgot about 
how to select just line 1 like that. 
Thanks!

On Thu, 13 May 2004 23:53:33 -0400
Joel Hammer <joel at hammershome.com> wrote:

> 
> cat junk | sed "1s/^...//"
> 
> This removes the first three characters of any file,
> maybe including binary files (I tried it with ogg123,
> and it seemed to work.)
> 
> You could try:
>      vi -b *(all files you want to change).
> 
> Use
>      :ls
> to see which files you have loaded.
> 
> You could then just 
>      :bn!
> to go to each file, and delete the first three characters by hand.
> For example, just delete the first three characters in the first file, then
>      :bn!
> to jump to the next file, and use the "." to repeat those
> keystrokes.
> 
> When done, use 
>      :wall
> to save all your changes.
> 
> Make backups before you start.
> 
> Joel
> 
> _______________________________________________
> Linux-users mailing list
> Linux-users at smtp.linux-sxs.org
> Unsubscribe/Suspend/Etc -> http://smtp.linux-sxs.org/mailman/listinfo/linux-users


-- 
-----------------------------------------------------------------------
| Alan K. Jackson            | To see a World in a Grain of Sand      |
| alan at ajackson.org          | And a Heaven in a Wild Flower,         |
| www.ajackson.org           | Hold Infinity in the palm of your hand |
| Houston, Texas             | And Eternity in an hour. - Blake       |
-----------------------------------------------------------------------



More information about the Linux-users mailing list