Data-Table-Text

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

      is_deeply nws($t), nws(<<END);
    Sample report.

    Table has 2 rows.

    This file: ${d}report.txt

          BC
    1  a
    2     b
          c
    END
      clearFolder($d, 2);

## formattedTablesReport   (@options)

Report of all the reports created. The optional parameters are the same as for [formatTable](#formattable).

       Parameter  Description
    1  @options   Options

**Example:**

      @formatTables = ();

      for my $m(2..8)
       {formatTable([map {[$_, $_*$m]} 1..$m], [q(Single), qq(* $m)],
          title=>qq(Multiply by $m));
       }


      ok nws(formattedTablesReport) eq nws(<<END);  # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲

       Rows  Title          File
    1     2  Multiply by 2
    2     3  Multiply by 3
    3     4  Multiply by 4
    4     5  Multiply by 5
    5     6  Multiply by 6
    6     7  Multiply by 7
    7     8  Multiply by 8
    END

## summarizeColumn ($data, $column)

Count the number of unique instances of each value a column in a table assumes.

       Parameter  Description
    1  $data      Table == array of arrays
    2  $column    Column number to summarize.

**Example:**

      is_deeply

       [summarizeColumn([map {[$_]} qw(A B D B C D C D A C D C B B D)], 0)],  # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲

       [[5, "D"], [4, "B"], [4, "C"], [2, "A"]];

      ok nws(formatTable
       ([map {[split m//, $_]} qw(AA CB CD BC DC DD CD AD AA DC CD CC BB BB BD)],
        [qw(Col-1 Col-2)],
         summarize=>1)) eq nws(<<'END');

    Summary_of_column                - Count of unique values found in each column                     Use the Geany flick capability by placing your cursor on the first word
    Comma_Separated_Values_of_column - Comma separated list of the unique values found in each column  of these lines and pressing control + down arrow to see each sub report.

        Col-1  Col-2
     1  A      A
     2  C      B
     3  C      D
     4  B      C
     5  D      C
     6  D      D
     7  C      D
     8  A      D
     9  A      A
    10  D      C
    11  C      D
    12  C      C
    13  B      B
    14  B      B
    15  B      D

    Summary_of_column_Col-1
       Count  Col-1
    1      5  C
    2      4  B
    3      3  A
    4      3  D

    Comma_Separated_Values_of_column_Col-1: "A","B","C","D"

    Summary_of_column_Col-2
       Count  Col-2
    1      6  D
    2      4  C
    3      3  B
    4      2  A

    Comma_Separated_Values_of_column_Col-2: "A","B","C","D"
    END

## keyCount($maxDepth, $ref)

Count keys down to the specified level.

       Parameter  Description
    1  $maxDepth  Maximum depth to count to
    2  $ref       Reference to an array or a hash

**Example:**

    my $a = [[1..3],       {map{$_=>1} 1..3}];

    my $h = {a=>[1..3], b=>{map{$_=>1} 1..3}};


    ok keyCount(2, $a) == 6;                                                        # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲




( run in 0.869 second using v1.01-cache-2.11-cpan-71847e10f99 )