Sponsored Content
Full Discussion: Grouping and counting
Top Forums Shell Programming and Scripting Grouping and counting Post 302979483 by Nik44 on Monday 15th of August 2016 09:52:07 AM
Old 08-15-2016
Thanks for the reponses! I've gone for the more straight forward cut option as it provides the desired output.

However I forgot to add to this question... Is there a way of refining this output further so that it will only count a record of that group where field four is "1" and where field five is "Y"? I realise in the example supplied it would still show the exact same count.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

egrep and grouping

i am using the c shell on solaris. directories i'm working with: ls -1d DIV* DIV_dental/ DIV_ibc/ DIV_ifc/ DIV_index/ DIV_pharm/ DIV_sectionI/ DIV_sectionI-title/ DIV_sectionI-toc/ DIV_sectionII-title/ DIV_sectionII-toc/ DIV_standing/ DIV_standing-toc/ DIV_title/ DIV_vision/ (1 Reply)
Discussion started by: effigy
1 Replies

2. UNIX for Dummies Questions & Answers

Help with data grouping

Hi all, I have a set data as shown below, and i would like to eliminate the name that no children - boy and girl. What is the appropriate command can i use(other than grep)? Please assist... My input: name sex marital status children - boy children - girl ... (3 Replies)
Discussion started by: 793589
3 Replies

3. UNIX for Advanced & Expert Users

grouping lines

Hi all, I have input lines like below: A;100;Paris;City;10;0;0 A;100;Paris;City;0;10;0 A;100;Paris;City in Europe;0;0;20 B;101;London;City;20;0;0 B;101;London;City;0;20;0 B;101;London;City in Europe;0;0;40 I need to group the above lines to: A;100;Paris;City in Europe;10;10;20... (4 Replies)
Discussion started by: andy2000
4 Replies

4. Shell Programming and Scripting

Selective grouping

I have a text file in this format. Group: AAA Notes: IP : 11.11.11.11 #User xxxxxxxxx #Password aaaaaaaaaaaaaaaa Group: AAA Notes: IP : 11.11.11.22 #User yyyyyyyyyyyyy #Password bbbbbbbbbbbbb (8 Replies)
Discussion started by: anil510
8 Replies

5. UNIX for Dummies Questions & Answers

Grouping in grep

How do you do grouping in grep? Here's how I tried it at first: egrep 'qualit(y|ies)' /usr/share/dict/words -bash: syntax error near unexpected token `(' I'm using GNUgrep, and I found this on their site. grep regular expression syntax So I tried this: egrep 'qualit\(y\|ies\)'... (2 Replies)
Discussion started by: sudon't
2 Replies

6. Shell Programming and Scripting

Grouping

Hi all, I am using following command: perl program.pl input.txt output.txt CUTOFF 3 > groups_3.txt containing program.pl, two files (input.txt, output.txt) and getting output in groups_3.txt: But, I wish to have 30 files corresponding to each CUTOFF ranging from 0 to 30 using the same... (1 Reply)
Discussion started by: bioinfo
1 Replies

7. Shell Programming and Scripting

UNIX grouping

Hi guys, I am a complete newbie to unix and have been tasked with creating a script to group the following data (file) by hourly slots so that I can count the transactions completed within the peak hour. I am not sure how to group data like this in unix. Can anyone please help? Here is an... (1 Reply)
Discussion started by: MrMidas
1 Replies

8. Shell Programming and Scripting

Name grouping

awk 'FNR==NR {a; next} $NF in a' genes.txt refseq_exons.txt > output.txt I can not figure out how to group the same name in $4 together. Basically, all the SKI together in separate rows and all the TGFB2. Thank you :). chr1 2160133 2161174 SKI chr1 218518675 218520389 TGFB2... (1 Reply)
Discussion started by: cmccabe
1 Replies

9. Shell Programming and Scripting

Grouping and Calculating

Hi All, I want to read the input file and store the output in the Output file. I pasted the sample Input and Output file below. Help me with this. Input file ================================= ITEM1 AAAAA 1 ITEM1 BBBBB 1 ITEM1 CCCCC 1 ITEM2 AAAAA 5 ITEM2 CCCCC 4... (1 Reply)
Discussion started by: humaemo
1 Replies

10. Shell Programming and Scripting

Help with grouping and zipping

Hi can you please help with the below ? source file: Column1,Column2,Column3,Column4 abc,123,dir1/FXX/F19,1 abc,123,dir1/FXX/F20,1 abc,123,dir1/FXX/F23,2 abc,123,dir1/FXX/C25,2 abc,123,dir1/FXX/X25,2 abc,123,dir1/FXX/A23,3 abc,123,dir1/FXX/Z25,3 abc,123,dir1/FXX/Y25,4 I want to... (3 Replies)
Discussion started by: paul1234
3 Replies
LSROLL(1p)						User Contributed Perl Documentation						LSROLL(1p)

NAME
lsroll - List the rollrecs in a DNSSEC-Tools rollrec file SYNOPSIS
lsroll [options] <rollrec-files> DESCRIPTION
This script lists the contents of the specified rollrec files. All rollrec files are loaded before the output is displayed. If any rollrecs have duplicated names, whether within one file or across multiple files, the later rollrec will be the one whose data are displayed. OUTPUT FORMATS
The output displayed for each zone in a rollrec file depends on the selected records, the selected attributes, and the selected output format. Each option in these option groups is described in detail in the next section. The three base output formats, along with the default -skip format, are described here. The -terse option indicates that a minimal amount of output is desired; the -long option indicates that a great deal of output is desired. The record-selection and attribute-selection options may be used in conjunction with -terse to display exactly the set of rollrec fields needed. The default output format is that used when neither -terse nor -long is given, and is a middle ground between terse and long output. If the -skip option is given, then the default output format is a little more restricted than the normal default. Some rollrec fields don't make sense in the context of a skip records, and so are given as "---". These fields are the KSK rollover phase, the ZSK rollover phase, the TTL value, and the phase start. The table below shows the fields displayed for each output format. rollrec field default terse long skip ------------- ------- ----- ---- ---- rollrec name yes yes yes yes rollrec type no no yes no zonename no no yes yes zone file yes no yes yes zonegroup no no yes no keyrec file yes no yes yes KSK phase yes no yes no ZSK phase yes no yes no administrator no no yes no directory no no yes no logging level no no yes no TTL value no no yes no display flag no no yes no phase start no no yes no last KSK rollover no no yes no last ZSK rollover no no yes no zonesigner arguments no no yes no The rollrec name field is often the same as its zonename, but this is not necessarily the case. The rollrec name can contain spaces, while the zonename can't. For this reason, lsroll displays the rollrec name in quotes, even if the name contains no spaces. This is intended to allow for easier parsing by other programs. OPTIONS
There are three types of options recognized by lsroll: record-selection options, attribute-selection options, and output-format options. Each type is described in the subsections below. Record-selection Options These options select the records that will be displayed by lsroll. By default, all records will be displayed; selecting one or the other of these options will restrict the records shown. In order to simplify the lsroll code and keep it easily understandable, these options are mutually exclusive. -roll List all "roll" records in the rollrec file. -skip List all "skip" records in the rollrec file. Attribute-selection Options These options select the attributes of the records that will be displayed by lsroll. -type Include each rollrec record's type in the output. The type will be either "roll" or "skip". -zonename The record's zonename is included in the output. The zonename is distinct from the record's rollrec name, which is always included in the output. While these two fields are often the same, they need not be. In split-zone zones, the rollrec names must be different, while the zonename field is the same. -zonefile The record's zonefile is included in the output. This field is part of the default output. -zg The record's zonegroup is included in the output, enclosed in double quotes. If a rollrec does not contain a zonegroup, then the value "" is given. -keyrec The record's keyrec file is included in the output. This field is part of the default output. -kskphase The record's KSK rollover phase are included in the output. If this option is given with the -zskphase option, then the output will follow the format described for the -phases option. This field is part of the default output. -zskphase The record's ZSK rollover phase are included in the output. If this option is given with the -kskphase option, then the output will follow the format described for the -phases option. This field is part of the default output. -phases The record's KSK and ZSK rollover phases are included in the output. The listing is given with the KSK phase first, followed by the ZSK phase. Examples of output from this option are: KSK phase ZSK phase output 0 0 0/0 3 0 3/0 0 5 0/5 -admin The record's administrator value is included in the output. If an administrator value is not included in a rollrec, then the value "(defadmin)" will be given. -directory The name of the directory that holds the zone's files is included in the output. If a zone directory is not included in a rollrec, then the value "(defdir)" will be given. -loglevel The rollerd logging level for this zone. This value may be given in the rollrec file in either the textual or numeric form. The textual form of the logging level will be displayed, not the numeric. If a logging level value is not included in a rollrec, then the value "(deflog)" will be given. If an undefined logging level value is included in a rollrec, then the value "(unknownlog)" will be given. -ttl The record's TTL value is included in the output. -display The record's display flag, used by blinkenlights, is included in the output. -phstart The record's rollover phase is included in the output. If no rollover has yet been performed for this zone, an empty date is given. -lastksk The record's last KSK rollover date is included in the output. If no KSK rollover has yet been performed for this zone, an empty date is given. -lastzsk The record's last ZSK rollover date is included in the output. If no ZSK rollover has yet been performed for this zone, an empty date is given. -zsargs The record's user-defined zonesigner arguments are included in the output. If no arguments have been set for this zone, then the value "(none)" is given. -zonegroup The zonegroups defined in the rollrec are listed, enclosed in double quotes. All other rollrec fields are ignored. If the -long option is specified, then each zonegroup name will be accompanied by the number of rollrec entries in that zonegroup. Output-format Options These options select the type of output that will be given by lsroll. -count Only a count of matching keyrecs in the rollrec file is given. -headers Display explanatory column headers. -terse Terse output is given. Only the record name and any other fields specifically selected are included in the output. -long Long output is given. All record fields are included. -help Display a usage message. -Version Displays the version information for lsroll and the DNSSEC-Tools package. COPYRIGHT
Copyright 2005-2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details. AUTHOR
Wayne Morrison, tewok@tislabs.com SEE ALSO
blinkenlights(8), rollchk(8), rollinit(8), rollerd(8) Net::DNS::SEC::Tools::rollrec.pm(3) file-rollrec(5) perl v5.14.2 2012-06-21 LSROLL(1p)
All times are GMT -4. The time now is 11:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy