Re: sum a column

2004-10-04 Thread rmck
, September 30, 2004 5:32 PM To: rmck; [EMAIL PROTECTED] Subject: Re: sum a column Hello, Im trying to sum up a column from my results. Help. current output: Date_Time, SRCIP, DSTIP, TOTALBYTES 01-01-2004 12:56:48, 192.168.1.1, 192.168.2.2, 2768 Sum Of Bytes = 2768 01-01-2004 12:56:48

RE: sum a column

2004-10-02 Thread rmck
To: [EMAIL PROTECTED] Subject: Re: sum a column Rmck wrote: Gunnar Hjalmarsson wrote: Rmck wrote: Im not sure how to sum up the column... I tried by using the field and * it by the increment. That awkward attempt seems to be made by someone who hasn't a clue about programming. I have

Re: sum a column

2004-10-01 Thread rmck
PROTECTED] Sent: Friday, October 01, 2004 2:53 AM To: [EMAIL PROTECTED] Subject: Re: sum a column Rmck wrote: Are you serious. Indeed. Im not sure how to sum up the column... I tried by using the field and * it by the increment. That awkward attempt seems to be made by someone who hasn't

sum a column

2004-09-30 Thread rmck
Hello, Im trying to sum up a column from my results. Help. current output: Date_Time, SRCIP, DSTIP, TOTALBYTES 01-01-2004 12:56:48, 192.168.1.1, 192.168.2.2, 2768 Sum Of Bytes = 2768 01-01-2004 12:56:48, 192.168.2.2, 192.168.1.1, 438 Sum Of Bytes = 876 01-02-2004 16:49:45, 192.168.3.3,

Re: sum a column

2004-09-30 Thread rmck
: Gunnar Hjalmarsson [EMAIL PROTECTED] Sent: Sep 30, 2004 5:21 PM To: [EMAIL PROTECTED] Subject: Re: sum a column Rmck wrote: Im trying to sum up a column from my results. Help. job specification snipped Im stuck. I don't believe you. To be stuck, you need to try first, and I suspect that you

Between times

2004-08-24 Thread rmck
Hello, I have a script that I want to print only if between 08:00 and 17:00. Would I match every hour then print?? Any cleaner way to do this would be great. Thanks my($sec,$min,$hour,$mday,$mon); ($sec,$min,$hour,$mday,$mon)=localtime; $timestamp=sprintf(%3s %02d

Counting help

2004-06-16 Thread rmck
Im trying to list a record once and then count how many records. But I keep getting a list of all the records and it counts those?? I read in a file with a list of rooms and then look for each one that matches dept 22 and Im trying to show it once and then count how many for the building?

Re: Counting help

2004-06-16 Thread rmck
11BLD:333 For 20 : 1BLD:1544 2BLD:1544 My goal was to have this output: For 30 : 10BLD:211 1BLD:333 For 20 : 2BLD:1544 Thanks.. -Original Message- From: Wiggins d Anconia [EMAIL PROTECTED] Sent: Jun 16, 2004 7:23 AM To: rmck [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: Counting help

unpack() help

2004-06-02 Thread rmck
Hi I have the .h file of a program that spits out a data file which is Binary Output. The binary file is a series of fixed length records. In C, each record has the format which is in the script. I thought I could use unpack to read the data, and I am having no success. PLEASE let me

check my split

2004-05-13 Thread rmck
Hello, This code below works. But I am wondering if it can be made more efficient: while (FHOREAD) { my $sport = (split(/\s/,$_))[8]; my $sdport = (split(/\s/,$_))[10]; next if $sport =~ /\D/; next if $dport =~ /\D/; if ($sport =~ /^(20|21|22|25|53|80|109|110|123|137|161|443)$/ || $dport

next if question

2004-04-22 Thread rmck
hi, I have a while statement that does a next if a match is made against a reg exprerssion of some numbers. data file: Header 10 20 5201 8001 0 80 3802 #!/bin/perl use strict; use warnings; while( ) { #read from stdin one line or record at a time. next if

Re: next if question

2004-04-22 Thread rmck
II [EMAIL PROTECTED] Sent: Apr 22, 2004 6:59 AM To: rmck [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: next if question On Apr 22, 2004, at 8:54 AM, rmck wrote: hi, I have a while statement that does a next if a match is made against a reg exprerssion of some numbers. data file

sort stdin and print

2004-03-18 Thread rmck
HI I have a script that reads stdin from the output of another script and cleans it up and prints it. The script gets ip's. I would like to sort it and and eliminate duplicates count the sorted/unique ips then print??? I thought using the perl sort command would help but it did not... I

Re: sort stdin and print

2004-03-18 Thread rmck
IP'S = 2 Not Ip=111.111.13473 Thanks, Rob -Original Message- From: John W. Krahn [EMAIL PROTECTED] Sent: Mar 18, 2004 10:39 AM To: [EMAIL PROTECTED] Subject: Re: sort stdin and print Rmck wrote: HI Hello, I have a script that reads stdin from the output of another script

variable issue

2004-02-24 Thread rmck
Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. I can run that awk statement on the command line and it works great, but if I try it in the script it fails with an awk syntax error... Is there a way to look at last

search an replace

2004-01-22 Thread rmck
Hi This scripts sucks in a 109mb file and i'm trying to do a search and replace on unxtime to the format from strftime. Which is working... But I run this system call and it took allnight to run :( So I killed it... Any other suggestions to reach my goal. #!/usr/bin/perl use strict;

format localtime()

2004-01-21 Thread rmck
Hi I have the following script that sucks in a file and converts unix timestamp to human readable.. The Goal is to do a search and replace of unix time to the format i need. But I'm just trying to get it to print in the format i need first... I cant get localtime to print in mm-dd-

script for passwd file

2003-12-16 Thread rmck
Hi, I'm stuck and that I would ask if anyone has a script to check for empty passwords /etc/passwd/ /etc/shadow and then lock them Thanks Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

getting end of an array

2003-10-09 Thread rmck
Hi, I have a script that I what the last part of the element of an array? So I can restart the script with the same element. Help: #!/bin/perl use strict; # Need IP of current procees so I can re-start it. # How it is returned: # root 6762 1355 0 Oct 05 pts/20:00 /bin/perl -w

Perl and cron

2003-10-02 Thread rmck
Hi and Help, I have a perl script (A) that spawns a unix command and pipes that to a log file. Then at 23:59 I have a perl script (B) that kills script (A). At midnight script (A) is kicked off. My issue is my killing of srcipt (A) is not working. It either is showing under ps, but not doing

Script runs once

2003-09-29 Thread rmck
Hello, I have a perl script that is to stop and start at midnight, and write to a new log file. The problem is it runs once then does not run again?? Below is the script that I am tring to use?? bash-2.03# #!/bin/perl -w use warnings; use strict; my ( $sec, $min, $hour, $day, $mon,

sprintf question

2003-09-23 Thread rmck
How do you use a shell command in a sprintf. Im trying to add the week of the year to the end of my file name: my $logfile = sprintf '/var/sno/weeks/week_'. `date +%W`.'/%02d%02d%02d%02d%02d.sno', $year % 100, $mon + 1, $day, $hour, $min; but when it is used I get: bash-2.03# ./script.pl

stop/start

2003-09-22 Thread rmck
Hi I'm trying to get this to work in perl. I want to start a unix process send it to a log file. Then at midnight kill it and restart it, with the date at the top. I'm starting with the following but the intial start of the proccess is not working right: #!/bin/perl $date = `date | awk

Parse text file and increment

2003-08-20 Thread rmck
Hello, I have a perl script that opens up a text file and displays the data fine. My textfile: 111.111.111.1-25|DEPTA 222.222.222.50-60|DEPTB What I would like to do is have it increment 1 through 25, and 50 through 60, and display that like so: SO FAR .. here is the data file