Sponsored Content
Full Discussion: Display the count of files
Top Forums Shell Programming and Scripting Display the count of files Post 302156906 by wayne1411 on Wednesday 9th of January 2008 12:42:58 PM
Old 01-09-2008
Thanks both of you. Both answers proved to be very useful. I now have a much better understanding of find and wc. also, I now feel very confident about the pipe key, whereas before I was somewhat unsure about it. thanks again.

-Kevin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to display and count

Hi there, I'd like to find a way to display a string and count the words in it. supernova:~# echo 'hello world' | tee - | wc Unfortunately, this doesn't work. Any idea? Thanks in advance. Santiago (15 Replies)
Discussion started by: chebarbudo
15 Replies

2. Shell Programming and Scripting

Read File and Display The Count of a particular field

Hi Mates, I require help in the following: I have the following file snmp.txt Wed Mar 2 16:02:39 SGT 2011 Class : mmTrapBladeS origin : 10.0.0.0 hostname : 10.0.0.2 msg : IBM Blade Alert: Calendar Index : 10.0.0.2-IBMBLADE Fri Mar 4 07:10:54 SGT 2011 Class : mmTrapBladeS... (2 Replies)
Discussion started by: dbashyam
2 Replies

3. UNIX for Dummies Questions & Answers

Single UNIX command to display users and to count them

Hello everyone, I am new to Unix and I am stuck with a problem. I need only a single command to display the output of who and then add the total number of users and display at the bottom of that output. Example-: (Expected output) sreyan@debian:~$ <command> sreyan tty7 ... (7 Replies)
Discussion started by: sreyan32
7 Replies

4. Shell Programming and Scripting

To search for a particular tag in xml and collate all similar tag values and display them count

I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help File: <xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies

5. Programming

SQL*PLUS How to display a count of 0

Hi, I have been frantically googling and checking some sqlplus forums, but can't find the correct syntax. Basically within sqlplus I want to do a count on a table and if the count is 0 it displays 0 instead of "no rows found". For eample: select count(*) from tableA where... (3 Replies)
Discussion started by: chris01010
3 Replies

6. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

7. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

8. Shell Programming and Scripting

Count the number of string occurrences to display 0 entries in output

Hello Friends, Can somebody assist an issue I am having? I have a separate file with a list of account ids XXX200B02Y01 XXX200B03Y01 XXX200B05Y01 XXX200B07Y01 XXX200B08Y01 I call the file, and run an egrep against a directory and logfiles AccountID=$(cat... (2 Replies)
Discussion started by: liketheshell
2 Replies

9. UNIX for Beginners Questions & Answers

How to find the count of IP addresses that belong to different subnets and display the count?

Hi, I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output Here is how my file looks like 1.1.1.1 1.1.1.2 1.1.1.3 1.1.2.1 1.1.2.2 1.1.3.1 1.1.3.2 1.1.3.3 1.1.3.4 So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
TAP::Parser::IteratorFactory(3pm)			 Perl Programmers Reference Guide			 TAP::Parser::IteratorFactory(3pm)

NAME
TAP::Parser::IteratorFactory - Figures out which SourceHandler objects to use for a given Source VERSION
Version 3.26 SYNOPSIS
use TAP::Parser::IteratorFactory; my $factory = TAP::Parser::IteratorFactory->new({ %config }); my $iterator = $factory->make_iterator( $filename ); DESCRIPTION
This is a factory class that takes a TAP::Parser::Source and runs it through all the registered TAP::Parser::SourceHandlers to see which one should handle the source. If you're a plugin author, you'll be interested in how to "register_handler"s, how "detect_source" works. METHODS
Class Methods "new" Creates a new factory class: my $sf = TAP::Parser::IteratorFactory->new( $config ); $config is optional. If given, sets "config" and calls "load_handlers". "register_handler" Registers a new TAP::Parser::SourceHandler with this factory. __PACKAGE__->register_handler( $handler_class ); "handlers" List of handlers that have been registered. Instance Methods "config" my $cfg = $sf->config; $sf->config({ Perl => { %config } }); Chaining getter/setter for the configuration of the available source handlers. This is a hashref keyed on handler class whose values contain config to be passed onto the handlers during detection & creation. Class names may be fully qualified or abbreviated, eg: # these are equivalent $sf->config({ 'TAP::Parser::SourceHandler::Perl' => { %config } }); $sf->config({ 'Perl' => { %config } }); "load_handlers" $sf->load_handlers; Loads the handler classes defined in "config". For example, given a config: $sf->config({ MySourceHandler => { some => 'config' }, }); "load_handlers" will attempt to load the "MySourceHandler" class by looking in @INC for it in this order: TAP::Parser::SourceHandler::MySourceHandler MySourceHandler "croak"s on error. "make_iterator" my $iterator = $src_factory->make_iterator( $source ); Given a TAP::Parser::Source, finds the most suitable TAP::Parser::SourceHandler to use to create a TAP::Parser::Iterator (see "detect_source"). Dies on error. "detect_source" Given a TAP::Parser::Source, detects what kind of source it is and returns one TAP::Parser::SourceHandler (the most confident one). Dies on error. The detection algorithm works something like this: for (@registered_handlers) { # ask them how confident they are about handling this source $confidence{$handler} = $handler->can_handle( $source ) } # choose the most confident handler Ties are handled by choosing the first handler. SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview. Example If we've done things right, you'll probably want to write a new source, rather than sub-classing this (see TAP::Parser::SourceHandler for that). But in case you find the need to... package MyIteratorFactory; use strict; use vars '@ISA'; use TAP::Parser::IteratorFactory; @ISA = qw( TAP::Parser::IteratorFactory ); # override source detection algorithm sub detect_source { my ($self, $raw_source_ref, $meta) = @_; # do detective work, using $meta and whatever else... } 1; AUTHORS
Steve Purkis ATTRIBUTION
Originally ripped off from Test::Harness. Moved out of TAP::Parser & converted to a factory class to support extensible TAP source detective work by Steve Purkis. SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::SourceHandler, TAP::Parser::SourceHandler::File, TAP::Parser::SourceHandler::Perl, TAP::Parser::SourceHandler::RawTAP, TAP::Parser::SourceHandler::Handle, TAP::Parser::SourceHandler::Executable perl v5.18.2 2014-01-06 TAP::Parser::IteratorFactory(3pm)
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy