Operating System - HP-UX
1753838 Members
8773 Online
108806 Solutions
New Discussion юеВ

Re: need script to add kr/s and kw/s columns for a specific time window

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: need script to add kr/s and kw/s columns for a specific time window

Hi (again):

In answer to your last question:

# perl -e 'while (<>) {chomp;if ($.==1) {$prev=$_;next};print join " ",$prev,$_,"\n";$prev=$_}' file

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: need script to add kr/s and kw/s columns for a specific time window

Hi Mike:

Did I solve your *original* question to your satisfaction, or do you have more?

Regards!

...JRF...
Mike_Ca Li
Regular Advisor

Re: need script to add kr/s and kw/s columns for a specific time window

Thank you for replies.
James R. Ferguson
Acclaimed Contributor

Re: need script to add kr/s and kw/s columns for a specific time window

HI Mike:

Points for efforts are greatly appreciated. I believe I provided you answers to your original question and in an oversight you haven't provided feedback.

http://forums11.itrc.hp.com/service/forums/helptips.do?#28

...JRF...
Dennis Handly
Acclaimed Contributor

Re: need script to add kr/s and kw/s columns for a specific time window

>The awk command created: ... Instead of:

Oops, didn't look close enough. Try this:
awk '
BEGIN { getline prev }
{
print prev, $0
prev = $0
}' file