You can also try the following methods:
more filename
less filename
vi -R filename
view filename
cat filename
Main Topics
Browse All TopicsI am trying to read some large log files in ksh on solaris.
When opening in vi, I get Line Too Long and cannot browse the file
I try grepping for a string (a user id) and sending it to another file, but still get
[Read only] Line too long, and cannot browse that file.
Looking thru the Experts-Exchange archives, I have tried
vi -R file
and view file
This is the size of the files. How can I view these.
grep userid logfile > grep_4_userid.out
133288292 Feb 3 11:18 logfile
57109 Feb 4 11:57 grep_4_userid.out
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
from
http://www.mcsr.olemiss.ed
vi has a limit of 15,687,678 editable lines. Attempts to edit or create
files larger than this limit cause vi to terminate with an appropriate
error message. There is also a limit of 8192 bytes per line (languages
with multibyte characters may therefore have fewer than 8192 characters
per line; otherwise this is also the number of characters per line.
Files with longer lines are not edittable (or even viewable) with this
editor. Use of either fold(1) or fmt(1) on the file (while changing the
contents) can be used to avoid this limit.
Get a better vi. Try vim ( http://www.vim.org/ ). I believe that it doesn't have arbitrary line length limitations.
csplit still gave me File Too Long and when trying to open the file created with fold
gave me No space left on device /var/tmp
So, I combined the 2 suggestions and used
csplit -k vrgateway3.05_02_02 100000 {99999}
fold xx14 > ted.fold
csplit broke the file down into many separate files (xx1 - xx100) and I used the fold command to organized the xx14 file into manageable line widths. Wow, this was complicated and do appreciate the advice from all of you. I plan to accept manav and ashish's answers, but am still looking for a simpler solution and will add points for a better solution.
hmm, simple suggestions:
use split not csplit, same result as you alreayd have manages, but keep in mind that your pattern my be split too
use less (like vim no problems with line length or number of lines)
use perl (no limititations at all, ecept if the pattern is larger than your physical memory, but then you'll
first encounter problems in writing it down:)
hi ,
split is good idea,
me myself few times edited long files before (netlist of a chip =~ 100-200 Mbytes , or SDF file of a gate-level chip model ~ 1G byte !!!)
another way :
use perl swap function to SHORTEN lines' length :
use Text::Wrap
$Text::Wrap::columns = 75;
then
open (FILE,">big_file");
@lines = <FILE>;
while (@lines) {
print FILE wrap('', '', $payload);
}
Hello,
the problem is really when I have to use vi on Solaris 9 machine. I can't just install another vi. the tools are limited, so I didn't find a solution yet.
vi -R <filename> does not help -R is for read only. What does it has to do with line length
I tried setting COLUMNS and LINES
it affects the terminal values but vi seem to be resistent
I don't see any possibility to use vi and have to read files with more. For editing I have to download / upload - fold is not useful because lines are broken
regards
Wow, a question from four years ago. :)
The line length limitation here is hard-coded into vi, and cannot be reconfigured without recompiling vi. So no environment variables or options will help you.
The "less" program (which I think is present by default in Solaris 9 in /bin or /usr or /usr/bin) has many of the same search features as vi. You can use '/' to search for a regexp. If you just want to browse and search through the file, then less is what you want.
how about installing vim from http://www.sunfreeware.com
I know that Sun distributed gcc on an extra software disk with Solaris 8 and Solaris 10, so they probably distribute it also with Solaris 9. You can also get a free license for Sun's old proprietary (Forte?) C compiler.
But still, if you just want to read the file, /bin/less is perfectly good for that. Do you want to edit it too?
There are other editors on Solaris. textedit and emacs are distributed by Sun.
Hi, thanks to all of you.
We have the Forte-C compiler that I could use. I was just wondering if there is not a kind of magic to do the job without compiling.
On linux I'm adicted to ne - a very kind editor, no one knows. So I'm going to try to compile this one and install it on the Solaris 9 boxes. May be there is SUNW package already
The problem is that we are not allowed to modify anything on the systems without a complicated testing cycle, but I hope I'll have understanding on this matter.
The problem with emacs is that it is way to large and with textedit that I don't know it.
Viewing with less is not possible because it's not installed, so I'm using more, which is not that comfortable, but the real problem is editing without using additional apps.
Annyway, I've got few ideas how I can solve the problem.
thanks to all of you
regards
Business Accounts
Answer for Membership
by: AxterPosted on 2005-02-04 at 09:32:28ID: 13227834
Did you try more?
more filename