Unix administration - open a huge file

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2006 > open a huge file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author open a huge file
blackdog

2006-03-07, 2:49 am

I have a huge file, could not open it by using vi or xemacs.
please help.

jakob

2006-03-07, 2:49 am

On 2006-03-07, blackdog <cljlk@hotmail.com> wrote:
> I have a huge file, could not open it by using vi or xemacs.
> please help.


grep? cat? What kind of file is this, and why do you want to open the
whole thing?

jakob
Doug Freyburger

2006-03-07, 5:54 pm

blackdog wrote:
>
> I have a huge file, could not open it by using vi or xemacs.
> please help.


The real problem you're facing is how it got too big in the first
place. Any method that let's you deal with the contents of
that file isn't going to help you with that real problem. Find
out why and treat the disease not the symptom. Any effort
of treating the symptom will eventually just yield a bigger
file the next time that eventually won't work with ways to
deal with the symptom.

One case where viewing the contents will help with the
cause not the symptom is if it's a log file. Look at all the
options for head and tail then start combining with perl,
awk, grep or whatever.

To be able to view it whole - Either make /tmp much bigger
so the temp file fits or expand swap space until it fits in
virtual memory. In principle files can grow to the point they
cannont fit in virtual memory so this would stop working
at the address space size of your host.

To chop it up into bite sized bits - see head, tail, split.
In general, viewing it whole isn't going to help, though. If
it won't fit in vi, there's no way you'll be able to scroll
through it and use your eyes as the processing method.
Efforts towards that are wasted without other types of
filtering.

somi

2006-03-21, 8:08 am

try with "more <file name> |pg"

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com