Thursday, March 17, 2022

Re: Large file - Opening n head lines

Thank you all of you. 

Le jeu. 17 mars 2022 à 19:24, Ni Va <nivaemail@gmail.com> a écrit :
Thank you Steve i think you sum up the more efficient way. Thank you. Nicolas. 😉 

Le jeu. 17 mars 2022 à 11:38, Steve Litt <slitt@troubleshooters.com> a écrit :
Ni Va said on Thu, 17 Mar 2022 01:41:08 -0700 (PDT)

>Hi All,
>
>Is it possible to open a Large File Vim but just only few beginning
>lines of it, edit one of these 50 first lines and then save and quit ?

head -n 50 bigfile.txt | vim -
# NOTE: Save as bigfile.new
tail +51 bigfile.txt >> bigfile.new
# NOTE: bigfile.new is now your edited file.

If you do it often, you can put it in a shellscript, and can even
rename the original to .bak.

HTH

SteveT

Steve Litt
March 2022 featured book: Making Mental Models: Advanced Edition
http://www.troubleshooters.com/mmm

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/jtqUuvOLZ5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220317063748.7670a1c1%40mydesk.domain.cxm.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAOKxv4HQ9a2os0BcTixD9Mgs12%3DZA2yyRjjvzgT_ynV65bp%2BSQ%40mail.gmail.com.

No comments:

Post a Comment