Sponsored Content
Full Discussion: Data mining a text file.
Top Forums Shell Programming and Scripting Data mining a text file. Post 302204888 by ghostdog74 on Thursday 12th of June 2008 09:52:26 PM
Old 06-12-2008
Code:
awk '/(root|[^n]uucp)/  { 
 total[$(NF-1)]++
}END {
 for( i in total) {
  print i,total[i]
 }
}' file

 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. Shell Programming and Scripting

Find and replace data in text file with data in same file

OK I will do my best to explain what I need help with. I am trying to format an ldif file so I can import it into Oracle oid. I need the file to look like this example. Keep in mind there are 3000 of these in the file. changetype: modify replace: userpassword dn:... (0 Replies)
Discussion started by: timothyha22
0 Replies

3. Shell Programming and Scripting

Filter a .kml file (xml) with data set from text file

I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file 11951 11952 74014 11964 11965 11969 11970 11971 11972 60149 74018 74023 86378 11976 11980 11983 11984 11987 (5 Replies)
Discussion started by: pcoj33
5 Replies

4. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
Perl::Critic::Statistics(3pm)				User Contributed Perl Documentation			     Perl::Critic::Statistics(3pm)

NAME
Perl::Critic::Statistics - Compile stats on Perl::Critic violations. DESCRIPTION
This class accumulates statistics on Perl::Critic violations across one or more files. NOTE: This class is experimental and subject to change. INTERFACE SUPPORT
This is considered to be a non-public class. Its interface is subject to change without notice. METHODS
"new()" Create a new instance of Perl::Critic::Statistics. No arguments are supported at this time. " accumulate( $doc, @violations ) " Accumulates statistics about the $doc and the @violations that were found. "modules()" The number of chunks of code (usually files) that have been analyzed. "subs()" The total number of subroutines analyzed by this Critic. "statements()" The total number of statements analyzed by this Critic. "lines()" The total number of lines of code analyzed by this Critic. "lines_of_blank()" The total number of blank lines analyzed by this Critic. This includes only blank lines in code, not POD or data. "lines_of_comment()" The total number of comment lines analyzed by this Critic. This includes only lines whose first non-whitespace character is "#". "lines_of_data()" The total number of lines of data section analyzed by this Critic, not counting the "__END__" or "__DATA__" line. POD in a data section is counted as POD, not data. "lines_of_perl()" The total number of lines of Perl code analyzed by this Critic. Perl appearing in the data section is not counted. "lines_of_pod()" The total number of lines of POD analyzed by this Critic. Pod occurring in a data section is counted as POD, not as data. "violations_by_severity()" The number of violations of each severity found by this Critic as a reference to a hash keyed by severity. "violations_by_policy()" The number of violations of each policy found by this Critic as a reference to a hash keyed by full policy name. "total_violations()" The the total number of violations found by this Critic. "statements_other_than_subs()" The total number of statements minus the number of subroutines. Useful because a subroutine is considered a statement by PPI. "average_sub_mccabe()" The average McCabe score of all scanned subroutines. "violations_per_file()" The total violations divided by the number of modules. "violations_per_statement()" The total violations divided by the number statements minus subroutines. "violations_per_line_of_code()" The total violations divided by the lines of code. AUTHOR
Elliot Shank "<perl@galumph.com>" COPYRIGHT
Copyright (c) 2007-2011 Elliot Shank. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07 Perl::Critic::Statistics(3pm)
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy