UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old September 13th, 2004, 12:11 AM
Rohit Sharma Rohit Sharma is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 Rohit Sharma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
file too long error

I am new to Unix
I have been opening files in vi editor by command:
vi filename

But for certain files while using this command following error is displayed:
File too long

Can anyone help me how to fix this error.
Thanks in Advance

Reply With Quote
  #2  
Old September 13th, 2004, 05:02 AM
andyb1ack andyb1ack is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 60 andyb1ack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 14 sec
Reputation Power: 4
Hi Rohit,

I'm no expert with vi but have found the following at URL
http://nscp.upenn.edu/aix4.3html/cmds/aixcmds6/vi.htm

Quote:
vi Editor Limitations
The following list provides the maximum limits of the vi editor. These counts assume single-byte characters.

{LINE_MAX} characters per line
256 characters per global command list
128 characters in the previously inserted and deleted text
128 characters in a shell escape command
128 characters in a string-valued option
30 characters in a tag name
128 map macros with 2048 characters total
1,048,560 lines of {LINE_MAX} characters per line silently enforced
Note: Running the vi editor on a file larger than 64MB may cause the following error message to display:
0602-103 file too large to place in /tmp


I don't know if it is possible to get round this particular limitation or even if the note is up to date, but it would make sense that there would be an upper limit on the size of file you can open for editing.

If you just wanting to read the contents of the file then obviously commands pg, more, less, tail, and head can help.

If you want to edit the file and the changes are small enough then "sed" might be a better tool. Otherwise, I'd probably split the file somehow and edit the chunks before putting it back together.

Hmmm.... I'm interested if anyone has any other tips.

Hope this helps until then.
Andy

Reply With Quote
  #3  
Old September 13th, 2004, 09:23 AM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,677 stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 3 h 18 m 44 sec
Reputation Power: 301
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
What O/S are you on? That is, Solaris, AIX, HP/UX, Linux, etc? Additionally, how big is the file you're trying to edit. You can do an ls -l on the file to see how big it is.

This sounds like it is an older O/S but the reality is that you simply may not be able to edit a file as big as you're trying to edit.

Reply With Quote
  #4  
Old September 14th, 2004, 11:27 AM
jlk's Avatar
jlk jlk is offline
Perl Jedi
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: New Hampshire
Posts: 108 jlk User rank is Sergeant (500 - 2000 Reputation Level)jlk User rank is Sergeant (500 - 2000 Reputation Level)jlk User rank is Sergeant (500 - 2000 Reputation Level)jlk User rank is Sergeant (500 - 2000 Reputation Level)jlk User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 10 h 41 m 53 sec
Reputation Power: 15
Quote:
Originally Posted by Rohit Sharma
I am new to Unix
I have been opening files in vi editor by command:
vi filename

But for certain files while using this command following error is displayed:
File too long

Can anyone help me how to fix this error.
Thanks in Advance



Basically, the file you are trying to view is unwrapped from the editors point of view. It doesn't contain any valid wrapping character.

My advice is to look around for a utility or script that will wrap the file at something like 80 bytes or so ( or one that will allow you to specify the wrap length ). Either way, that is what is quite possibly wrong.

Regards,

#jlk

Reply With Quote
  #5  
Old September 14th, 2004, 11:53 PM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,078 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 14 h 28 m 26 sec
Reputation Power: 9
note the diff:
a) line too long
b) file too long

also vi knows limits
in case a the line is >1024 chars
in case b the file is big, very big
split it, edit and cat

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > file too long error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway