HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help
Operating System - HP-UX
1830909
Members
1709
Online
110017
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
Forums
Discussions
Discussions
Discussions
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
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
05-03-2004 05:26 PM
05-03-2004 05:26 PM
Hi,
I've an input file with the following details:
SERVER1
AAAA:11111:BLAH BLAH:BLAH
bbbb:11111:BLAH BLAH:BLAH
#--------------------------#
SERVER2
STUFF:STUFF2:11111:TEST
#--------------------------#
....
and so on ...
I want to append or prepend the lines without colon (those are the lines with server1, server2 values) to the lines that follow those values (the lines with colon)
so that my output will look something like this ....
SERVER1:AAAA:11111:BLAH BLAH:BLAH
SERVER1:bbbb:11111:BLAH BLAH:BLAH
#--------------------------------#
SERVER2:STUFF:STUFF2:11111:TEST
#--------------------------------#
How do I go about doing this ?
Any help would be greatly appreciated.
Thanks,
Shabu
I've an input file with the following details:
SERVER1
AAAA:11111:BLAH BLAH:BLAH
bbbb:11111:BLAH BLAH:BLAH
#--------------------------#
SERVER2
STUFF:STUFF2:11111:TEST
#--------------------------#
....
and so on ...
I want to append or prepend the lines without colon (those are the lines with server1, server2 values) to the lines that follow those values (the lines with colon)
so that my output will look something like this ....
SERVER1:AAAA:11111:BLAH BLAH:BLAH
SERVER1:bbbb:11111:BLAH BLAH:BLAH
#--------------------------------#
SERVER2:STUFF:STUFF2:11111:TEST
#--------------------------------#
How do I go about doing this ?
Any help would be greatly appreciated.
Thanks,
Shabu
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2004 06:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2004 06:29 PM
05-03-2004 06:29 PM
Re: script help
Thanks Stuart !
That was pretty neat ...
-Shabu
That was pretty neat ...
-Shabu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2004 07:37 PM
05-03-2004 07:37 PM
Re: script help
a perl version...
$file=" open(file);
while() {
chomp;
~ m/:/g;
if (pos) { print "$header:$_\n"; }
else { $header=$_; }
}
close(file);
$file="
while(
chomp;
~ m/:/g;
if (pos) { print "$header:$_\n"; }
else { $header=$_; }
}
close(file);
--
"Reality is just a point of view." (P. K. D.)
"Reality is just a point of view." (P. K. D.)
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP