Mailinglist Archive: opensuse (3349 mails)

< Previous Next >
Re: [SLE] editor for extremely large test file
  • From: Anders Johansson <andjoh@xxxxxxxxxx>
  • Date: Wed, 11 May 2005 00:18:01 +0200
  • Message-id: <200505110018.01592.andjoh@xxxxxxxxxx>
On Wednesday 11 May 2005 00:06, James D. Parra wrote:
> Hello,
>
> Anyone know of an editor that can open a 39 GB text file? I need to locate
> and copy out a large block of text from this file, about 8 million rows, at
> roughly 200 MB of data.

sed

once you know the starting and ending lines of the block you want to copy, you
can do something like

sed -ne '<starting line>,<finishing line>p' infile > outfile

For example, if the block begins at line 5000 and ends at line 100000 it would
be

sed -ne '5000,100000p' infile > outfile

If the starting and ending lines are known, you can also match on them. For
example, if the starting line is ===start=== and the ending line is ===end===
it would be

sed -ne '/===start===/,/===end===/p' infile > outfile


< Previous Next >
References