How to edit a large file

Whenever I am trying to edit a file in unix with vi editor, I am getting the following error:

<data>
:Tmp file too large

Is there any way that I can edit the file other than vi. Any help is really appreciated.

Thanks

What size file?
What are you trying to edit as a file?

Well, the file size is over 7GB and I am trying to edit the very first few lines.
How am I going to achieve this?

Thanks

In that case use head command ...

Sorry, I didn't quite get that. Anything in detail would be highly appreciated. Thanks.

use VIM instead of VI

VIM: not found

VIM doesn't work either.

which vi
ls -l /usr/bin/vi
ls -l /bin/vi
find / -name 'vim' 2>/dev/null

or

grep -n test filename 
+ 
head -n filename | tail -1 > newfile

it is vim not VIM

vim file

--ahamed

 
vim <file>
 
vim: not found 
 

Well we've reached post #10 and we know that the file is over 7Gb and you want to edit it. We know nothing about the file itself, but other posters have suggested unix text file editing techniques. Is it a unix text format file with manageable record length?

Have you edited similar (but smaller) files in the same format? If so, what did you do?

Please post what Operating System and version you have.
Please describe the process or program which wrote this file (mentioning programming language or database engine if relevant).