答复: How to open a BIG file quickly?
-邮件原件- 发件人: Jean-Rene David [mailto:[EMAIL PROTECTED] 发送时间: 2007年4月6日 :00:09 收件人: Vim 主题: Re: How to open a BIG file quickly? * Tom Purl [2007.04.05 12:00]: I need to do that quite often. They are usually log files from a long running program in debug mode. Actually, you can think of a log file as a sort of flat file database. Here's an example I appreciate all the help but I really don't have a problem with large files. I *do* preprocess my large files with grep/awk/perl in all sorts of ways and *do* use vim to view and edit the resulting chunks. I am not the OP, and I was just mentioning log files because someone sounded surprised one might legitimately need to edit a 1GB file. And before somebody mentions it, I do know about logrotate... :-) -- JR Thank you all for the help. I'm a new user to GVIM, so I think I can use GVIM to open any files. Thanks to Christian Ebert [EMAIL PROTECTED] for giving the URL: Try http://www.vim.org/scripts/script.php?script_id=1506. It works. I think that grep/awk/perl can handle this case. (I'm a M$ user. :( ,and not install Cygwin, o(∩_∩)o... ) I'll study that. Please close this topic. -- Regards Chenfangrong
How to open a BIG file quickly?
Dear all, If I want to open one 1G bytes size file,it's really slow. Thank you in advance. --- Best regards longer
Re: How to open a BIG file quickly?
On Thu, April 5, 2007 2:38 am, ³Â·½ÈÙ wrote: Dear all, If I want to open one 1G bytes size file,it's really slow. Thank you in advance. Just out of curiosity, why are you trying to edit a 1 GB file with any text editor? I'm assuming that these files are flat file databases. If that's true, then why don't you just read and write to them using some sort of ODBC driver + database front end? That will give you far superior performance to a text editor. If you can't edit the file like it's a database, then I would seriously think about creating some sort of Perl or shell script to handle reading and writing. HTH! Tom Purl
Re: How to open a BIG file quickly?
* Tom Purl [2007.04.05 10:30]: On Thu, April 5, 2007 2:38 am, ³Â·½ÈÙ wrote: If I want to open one 1G bytes size file,it's really slow. I suggest splitting it into smaller chunks with another tool. Just out of curiosity, why are you trying to edit a 1 GB file with any text editor? I'm assuming that these files are flat file databases. I need to do that quite often. They are usually log files from a long running program in debug mode. -- JR
Re: How to open a BIG file quickly?
Just out of curiosity, why are you trying to edit a 1 GB file with any text editor? I'm assuming that these files are flat file databases. I need to do that quite often. They are usually log files from a long running program in debug mode. I find that pre-processing with grep/sed/awk first in a stream-like fashion can trim the file down to a manageable size before I heave the power of Vim at the problem. If, for example, I'm only interested in the ERRORS and want to skip the WARNINGs or the DEBUGs in the file, I might use bash grep ERROR infile.log smaller.log bash vi smaller.log or I might want to strip out the DEBUG level lines: bash grep -v DEBUG infile.log smaller.log I've had a couple log files clock in at over 300 megs...nothing so gargantuan as over a gig, but the principle is the same. -tim
Re: How to open a BIG file quickly?
* Tom Purl [2007.04.05 12:00]: I need to do that quite often. They are usually log files from a long running program in debug mode. Actually, you can think of a log file as a sort of flat file database. Here's an example I appreciate all the help but I really don't have a problem with large files. I *do* preprocess my large files with grep/awk/perl in all sorts of ways and *do* use vim to view and edit the resulting chunks. I am not the OP, and I was just mentioning log files because someone sounded surprised one might legitimately need to edit a 1GB file. And before somebody mentions it, I do know about logrotate... :-) -- JR
Re: How to open a BIG file quickly?
Tom Purl wrote: On Thu, April 5, 2007 2:38 am, ³Â·½ÈÙ wrote: Dear all, If I want to open one 1G bytes size file,it's really slow. Thank you in advance. Just out of curiosity, why are you trying to edit a 1 GB file with any text editor? I'm assuming that these files are flat file databases. If that's true, then why don't you just read and write to them using some sort of ODBC driver + database front end? That will give you far superior performance to a text editor. I don't know about the OP, but I've gotten several hundred megabyte files resulting from use of my in-line debugger while trying to debug an interpreter. So, its not necessarily a flat file database. FYIW, Chip Campbell