- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Appending a string to every line in text file
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
01-04-2005 07:31 PM
01-04-2005 07:31 PM
I had created a file abc with `ls > abc `.
I need to append a known string eg "zzzzzzz" to the end of everyline .
Is it possible.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2005 07:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2005 07:44 PM
01-04-2005 07:44 PM
Re: Appending a string to every line in text file
Hi Chuan,
You can do the following also:-
#vi abc
inside vi,
:se nu
:1,Xs/$/zzzzzz/g
where 'X' is the last line number
and 'zzzzzzz' is the word to be appended.
regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2005 08:30 PM
01-04-2005 08:30 PM
Re: Appending a string to every line in text file
#vi abc
(change vi mode to command mode) by press ESC, Shift+(;) then type
:1,$:s/^/xxxxxxx
(see attache docs for more detail)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2005 08:30 PM
01-04-2005 08:30 PM
Re: Appending a string to every line in text file
#vi abc
(change vi mode to command mode) by press ESC, Shift+(;) then type
:1,$:s/^/xxxxxxx
(see attache docs for more detail)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2005 08:56 PM
01-04-2005 08:56 PM
Re: Appending a string to every line in text file
sed '1,Xs/$/zzz/' abc > newfile
where X is the number of lines in the abc