- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vi editor
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 07:49 PM
07-14-2008 07:49 PM
vi editor
I have big text file with a lot of hashes (#), how can I view all the lines without hash on vi editor?
Where can I find a good in-depth knowledge document on vi?
Thanks,
RKK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 08:04 PM
07-14-2008 08:04 PM
Re: vi editor
Lines without "#" in column 1?
> [...] view [...]
View only, or change?
"man grep", look for "-v".
grep -v '#' file > file_nh ; vi -R file_nh
grep -v '^#' file > file_nh ; vi -R file_nh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 08:09 PM
07-14-2008 08:09 PM
Re: vi editor
For vi documents.... google with vi editor keyword. You will get lots of PDF links for vi editor documents. Few of them:
http://www.eng.hawaii.edu/Tutor/vi.html
http://unixhelp.ed.ac.uk/vi/index.html
-=ShRi=-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 08:16 PM
07-14-2008 08:16 PM
Re: vi editor
Actually I want make changes in the uncommented lines of a file through vi editor.
-RKK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 08:29 PM
07-14-2008 08:29 PM
Re: vi editor
Are you talking about editing the lines one by one or some global change all?
For the former, don't edit the lines starting with "#". For the latter, you can use:
:g/^[^#]/s/foo/bar/g
Or:
:v/^#/s/foo/bar/g
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 09:37 PM
07-14-2008 09:37 PM
Re: vi editor
The commented lines should be there in the file as before when I open it again.
-RKK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 09:45 PM
07-14-2008 09:45 PM
Re: vi editor
Is it that hard to just skip to the next uncommented line? :-)
>The commented lines should be there in the file as before
You can't do this in vi. I don't know about vim nor emacs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:26 PM
07-14-2008 10:26 PM
Re: vi editor
Some are GUI based editors, but looks like VIM can do it too.
Try it - good luck!
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2008 10:59 PM
07-14-2008 10:59 PM
Re: vi editor
1) ESC
2) :g/#/s///g
the syntax is:
:g/old_text/s//new_text/g
Best regards.
Ernesto