Head command

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Head command

Marcos Marconcini
Hi,

 

 I am trying to extract a portion of a large file, to do a sha1 check, it's
greater than 2.7Gb. I was reading help for head command, but it's only
permit me put number of lines to extract, and I need to extract the portion
of 1.5Gb in bytes, and generate a new file. Is this posible? How can I do ?
I am using openbsd 3.6. Any help are welcome!!!

 

Thanks in Advance.

 

 

Marcos

Reply | Threaded
Open this post in threaded view
|

Re: Head command

Damien Miller
man dd

On Tue, 8 Nov 2005, Marcos Marconcini wrote:

> Hi,
>
>
>
> I am trying to extract a portion of a large file, to do a sha1 check, it's
> greater than 2.7Gb. I was reading help for head command, but it's only
> permit me put number of lines to extract, and I need to extract the portion
> of 1.5Gb in bytes, and generate a new file. Is this posible? How can I do ?
> I am using openbsd 3.6. Any help are welcome!!!
>
>
>
> Thanks in Advance.
>
>
>
>
>
> Marcos

Reply | Threaded
Open this post in threaded view
|

Re: Head command

Rod.. Whitworth
In reply to this post by Marcos Marconcini
On Tue, 8 Nov 2005 03:11:43 -0300, Marcos Marconcini wrote:

>Hi,
>
>
>
> I am trying to extract a portion of a large file, to do a sha1 check, it's
>greater than 2.7Gb. I was reading help for head command, but it's only
>permit me put number of lines to extract, and I need to extract the portion
>of 1.5Gb in bytes, and generate a new file. Is this posible? How can I do ?
>I am using openbsd 3.6. Any help are welcome!!!
>

man split ?

>
>
>Thanks in Advance.
>
>
>
>
>
>Marcos
>
>

From the land "down under": Australia.
Do we look <umop apisdn> from up over?

Do NOT CC me - I am subscribed to the list.
Replies to the sender address will fail except from the list-server.

Reply | Threaded
Open this post in threaded view
|

Re: Head command

Nick Holland
In reply to this post by Marcos Marconcini
Marcos Marconcini wrote:
> Hi,
>
>  
>
>  I am trying to extract a portion of a large file, to do a sha1 check, it's
> greater than 2.7Gb. I was reading help for head command, but it's only
> permit me put number of lines to extract, and I need to extract the portion
> of 1.5Gb in bytes, and generate a new file. Is this posible? How can I do ?
> I am using openbsd 3.6. Any help are welcome!!!

Here's how I extract individual messages out of (large) mbox files:

tail -c +${2} ${1} |head -${3}

?

That jumps to the byte offset $2 and displays the next $3 lines of file $1.

BTW: make your files smaller than that if you can.  Multi-GB text files
work, but they are often unpleasantly slow to do anything with.

As usual...lots of ways to do most things.
(of course, most are wrong.  The above is probably an example of that :)

Nick.

Reply | Threaded
Open this post in threaded view
|

Re: Head command

Stan-18
In reply to this post by Marcos Marconcini
On Tue, Nov 08, 2005 at 03:11:43AM -0300, Marcos Marconcini wrote:

> Hi,
>
>  
>
>  I am trying to extract a portion of a large file, to do a sha1 check, it's
> greater than 2.7Gb. I was reading help for head command, but it's only
> permit me put number of lines to extract, and I need to extract the portion
> of 1.5Gb in bytes, and generate a new file. Is this posible? How can I do ?
> I am using openbsd 3.6. Any help are welcome!!!
>
>  

Perhaps the split command? Or a quick perl script.

--
U.S. Encouraged by Vietnam Vote - Officials Cite 83% Turnout Despite Vietcong Terror
- New York Times 9/3/1967