- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- simple vi question
Operating System - HP-UX
1757325
Members
2518
Online
108860
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО11-02-2001 10:39 AM
тАО11-02-2001 10:39 AM
Hey everyone i have a simple vi question here.
I have a file like this but instead of like 10 lines i have like 150.
1
2
3
4
5
5
6
7
8
9
10
And I want it to look like this:
1 ok
2 ok
3 ok
4 ok
5 ok
6 ok
7 ok
8 ok
9 ok
10 ok
I want an ok next to the number.
Thanks
Richard
I have a file like this but instead of like 10 lines i have like 150.
1
2
3
4
5
5
6
7
8
9
10
And I want it to look like this:
1 ok
2 ok
3 ok
4 ok
5 ok
6 ok
7 ok
8 ok
9 ok
10 ok
I want an ok next to the number.
Thanks
Richard
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-02-2001 10:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-02-2001 10:45 AM
тАО11-02-2001 10:45 AM
Re: simple vi question
Hi,
:%s/$/ OK/ if the number is everything on the line.
:%s/^[0-9]*/& OK / if there is more text after the number.
good luck,
Thierry.
:%s/$/ OK/ if the number is everything on the line.
:%s/^[0-9]*/& OK / if there is more text after the number.
good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-02-2001 10:45 AM
тАО11-02-2001 10:45 AM
Re: simple vi question
Hi Richard,
Use
vi file_name
esc --> :
:1,$ s/$/ ok/gp
Save file and exit. this will add " ok" at the end of each line.
hope this helps.
Regds
Use
vi file_name
esc --> :
:1,$ s/$/ ok/gp
Save file and exit. this will add " ok" at the end of each line.
hope this helps.
Regds
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP