- 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
12-10-2008 03:25 PM
12-10-2008 03:25 PM
vi-editor
I have 200 lines in a file. Now i need to deleted some lines in between the file.
for example: from 99th line to 150th line
how to delete using vi editor or any other method to do this.....please help me
Regards,
Veera
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 03:30 PM
12-10-2008 03:30 PM
Re: vi-editor
99
51dd
http://www.eng.hawaii.edu/Tutor/vi.html
http://www.gnulamp.com/vi.html
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 03:35 PM
12-10-2008 03:35 PM
Re: vi-editor
In 'vi' position the cursor on the 99th line (type escape, :99) and enter '51dd' to delete the next 51-lines.
You can use 'sed':
# sed -e '99,150d' file > file.new
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 04:01 PM
12-10-2008 04:01 PM
Re: vi-editor
i mentioned date and time for beginning
every of line...can you pls tell me how to sort the line in vi editor with date and time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 04:07 PM
12-10-2008 04:07 PM
Re: vi-editor
> i mentioned date and time for beginning
every of line...can you pls tell me how to sort the line in vi editor with date and time
Where in your original post did you mention anything about sorting or anything about timestamps?
What are you really trying to accomplish?
What (*exactly*) does your input file look like (post a snippet) and what (*exactly*) do you want to transform it into?
# man sort
...offers a great deal of information. One doesn't 'sort' in 'vi'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 04:14 PM
12-10-2008 04:14 PM
Re: vi-editor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 04:45 PM
12-10-2008 04:45 PM
Re: vi-editor
If you don't want to do complicated arithmetic in your head, you can just use:
:99,150d
If you want to use the visual editor you can mark the first line "ma", then go to the last line and then "d'a".
>tell me how to sort the line in vi editor with date and time
>JRF: One doesn't sort in vi.
Sure you can but you have to know the sort options.
If you want to sort the whole file, on the first line: !Gsort
You can also sort partial ranges using the mark command: !'asort
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2008 08:22 PM
12-10-2008 08:22 PM
Re: vi-editor
If you got your answer then from next time please assign points to those people who give there valuable time to help you out.
To know how to assign points please go through this below link
http://forums11.itrc.hp.com/service/forums/helptips.do?#33
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2008 11:50 AM
12-21-2008 11:50 AM