[clug] *nix editor for Gigabyte files? [SEC=PERSONAL]

Roppola, Antti Antti.Roppola at abare-brs.gov.au
Tue Aug 10 17:38:45 MDT 2010


Scott wrote:

On Tue, 10 Aug 2010 11:37:57 +1000 Michael James <clug3 at james.st> wrote:

>> What editor can quickly open multi gigabyte files on Linux?
>
>> The task is to find a string,
>>  check the line it's on has survived a Perl transform,  and edit it
if 
>> necessary.

>Try nano, easier again - try mc with nano :-D
>Re: task (fast)
>find xargs sed

I do this a lot to clean up data, I usually use Perl or some other sort
of stream editor. It just isn't sane to try load the whole file into
memory.

You can use sed expressions on Perl vars using the =~ operator. You
might also code in a test on your output to log any occurances of your
string and if/how it was edited. Say tee a copy of such lines off into a
separate file.

	$line =~ s/foo/bar/g;

Antti


------
IMPORTANT - This email and any attachments have been issued by the Australian Government Department of Agriculture, Fisheries and Forestry (DAFF).  The material transmitted is for the use of the intended recipient only and may contain confidential, legally privileged, copyright or personal information.  You should not copy, use or disclose it without authorisation from DAFF.  It is your responsibility to check any attachments for viruses and defects before opening or forwarding them.

If you are not an intended recipient, please contact the sender of this email at once by return email and then delete both messages.  Unintended recipients must not copy, use, disclose, rely on or publish this email or attachments.  DAFF is not liable for any loss or damage resulting from unauthorised use or dissemination of, or any reliance on, this email or attachments. 

If you have received this e-mail as part of a valid mailing list and no longer want to receive a message such as this one, advise the sender by return e-mail accordingly.

This notice should not be deleted or altered.


------



More information about the linux mailing list