Re: cut fails with "cut: memory exhausted" when taking a large slice
From:
Jim Meyering
Subject:
Re: cut fails with "cut: memory exhausted" when taking a large slice
Date:
Wed, 21 Apr 2004 23:08:06 +0200
Mordy Ovits <address@hidden> wrote:
> On Wednesday 21 April 2004 03:35 pm, Jim Meyering wrote:
>> If you want to continue using cut, you'll have better
>> luck with the latest:
>>
>> ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.2.1.tar.gz
>> ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.2.1.tar.bz2
>
> Doesn't work.
>
> address@hidden ~]$ ls -l ~/bigfile
> -rw-r--r-- 1 movits movits 9075738624 Apr 21 12:39 /home/movits/bigfile
>
> address@hidden ~]$ cut -b 1-412569600 ~/bigfile > firstchunk
>
> cut never stops. The file 'firstchunk' just gets bigger and bigger.
Hmm... I'll bet your data is not all on one line.
cut is a line-oriented tool, and it tries to read each
line in its entirety into memory, so it's probably not
the tool you want, after all. As I said, dd should work
better.