dbrowenumerate man page

dbrowenumerate — enumerate rows, starting from zero

Synopsis

dbrowenumerate

Description

Add a new column “count”, incremented for each row of data, starting with zero. Use dbrowaccumulate for control over initial value or increment; this module is just a wrapper around that.

Options

-N or --new-name N

Name the new column N. Defaults to "count".

This module also supports the standard jdb options:

-d

Enable debugging output.

-i or --input InputSource

Read from InputSource, typically a file name, or "-" for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.

-o or --output OutputDestination

Write to OutputDestination, typically a file name, or "-" for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.

--autorun or --noautorun

By default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The "--(no)autorun" option controls that behavior within Perl.

--help

Show help.

--man

Show full manual.

Sample Usage

Input

    #h account passwd uid gid fullname homedir shell
    johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
    greg * 2275 134 Greg_Johnson /home/greg /bin/bash
    root * 0 0 Root /root /bin/bash
    # this is a simple database

Command

    cat DATA/passwd.jdb | dbrowenumerate

Output

    #h account passwd uid  gid fullname       homedir     shell     count 
    johnh      *      2274 134 John_Heidemann /home/johnh /bin/bash 0     
    greg       *      2275 134 Greg_Johnson   /home/greg  /bin/bash 1     
    root       *      0    0   Root           /root       /bin/bash 2     
    # this is a simple database
    #  | /home/johnh/BIN/DB/dbrowenumerate

See Also

Fsdb, dbrowaccumulate.

Class Functions

Info

2016-01-04 perl v5.26.1 User Contributed Perl Documentation