hi all,
i have a problem with my nawk command output below is the description :
nawk $12 == "00008001" { cnt++;cs_cd } END {for(cd in cs_cd) print cd, cs_cd } 2007020814.TDR
output :
133
123
desire output:
133,123,....
please advices
thank you so much (6 Replies)
Hello!!
I am capturing and counting certain uniq occurance of certain evet from large log files.
below is my output I m getting with my script:
No of Messages Date Hour
150 Aug15 1
234 Aug15 2
345 Aug15 3
. ... (4 Replies)
Hi Experts,
I am adding a column of numbers with awk , however not getting correct output:
# awk '{sum+=$1} END {print sum}' datafile
2.15291e+06
How can I getthe output like : 2152910
Thank you..
# awk '{sum+=$1} END {print sum}' datafile
2.15079e+06 (3 Replies)
awk experts,
I have in put file with time stamp followed by "," separated data. same patern continues. The output need time stamp in first columns and data total in 2nd columns.
Input file
T 9:15
d0,1,3,3
d1,2,1,1
d2,3,1,5
e1,1,1,1
T 9:30
d0,1,1,1
d1,2,3,2
d3,1,2,1... (10 Replies)
hi
i have a awk command with several querys....
awk 'FS="|""; print $4, $5, $6...etc....
$4 gives me the date 20120304
$5 is timestamp 101023
I want to format these in
2012.03.04 or 2012/03/04
10:10:23
but have no idea, if this is possible with format-parameters in the awk... (2 Replies)
Hello,
I'm a bit stumped, for some reason when using AWK 'print' is not printing the entire date/line.
awk '{print "Ticket #: " $1}
{print "Queue : " $2}
{print "Recieved : " $3}
{print "AP Date : " $4}
{print "Circuit ID : " $5}
{print... (4 Replies)
Hello all , need help with this ...
Input File
DEV % POOL
0CB4 FBA 2211300 81792 4 IE RAID-5(3+1) R5_EFD100_1
- - 1805376 82 IF RAID-1 M2_FC300_1
- ... (4 Replies)
Hi All,
I have a data file (myfile.txt) as below:
- A H C
- A HHH F
- AAA HH I
The importan point is that the width between the columns are not fixed and the column seperator is space.
I wish to change the value of 4th column using awk only when $3 = HH. I can... (4 Replies)
Discussion started by: angshuman
4 Replies
LEARN ABOUT MOJAVE
io::dir
IO::Dir(3pm) Perl Programmers Reference Guide IO::Dir(3pm)NAME
IO::Dir - supply object methods for directory handles
SYNOPSIS
use IO::Dir;
$d = IO::Dir->new(".");
if (defined $d) {
while (defined($_ = $d->read)) { something($_); }
$d->rewind;
while (defined($_ = $d->read)) { something_else($_); }
undef $d;
}
tie %dir, 'IO::Dir', ".";
foreach (keys %dir) {
print $_, " " , $dir{$_}->size,"
";
}
DESCRIPTION
The "IO::Dir" package provides two interfaces to perl's directory reading routines.
The first interface is an object approach. "IO::Dir" provides an object constructor and methods, which are just wrappers around perl's
built in directory reading routines.
new ( [ DIRNAME ] )
"new" is the constructor for "IO::Dir" objects. It accepts one optional argument which, if given, "new" will pass to "open"
The following methods are wrappers for the directory related functions built into perl (the trailing 'dir' has been removed from the
names). See perlfunc for details of these functions.
open ( DIRNAME )
read ()
seek ( POS )
tell ()
rewind ()
close ()
"IO::Dir" also provides an interface to reading directories via a tied hash. The tied hash extends the interface beyond just the directory
reading routines by the use of "lstat", from the "File::stat" package, "unlink", "rmdir" and "utime".
tie %hash, 'IO::Dir', DIRNAME [, OPTIONS ]
The keys of the hash will be the names of the entries in the directory. Reading a value from the hash will be the result of calling
"File::stat::lstat". Deleting an element from the hash will delete the corresponding file or subdirectory, provided that "DIR_UNLINK" is
included in the "OPTIONS".
Assigning to an entry in the hash will cause the time stamps of the file to be modified. If the file does not exist then it will be
created. Assigning a single integer to a hash element will cause both the access and modification times to be changed to that value.
Alternatively a reference to an array of two values can be passed. The first array element will be used to set the access time and the
second element will be used to set the modification time.
SEE ALSO
File::stat
AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perlbug@perl.org>.
COPYRIGHT
Copyright (c) 1997-2003 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
perl v5.18.2 2013-11-04 IO::Dir(3pm)