Sponsored Content
Full Discussion: count lines in a pattern
Top Forums Shell Programming and Scripting count lines in a pattern Post 302497666 by yinyuemi on Thursday 17th of February 2011 06:11:18 PM
Old 02-17-2011
Code:
awk '/core\//{++x;a[y]=x}/Members/{x=0;y++}END{for (i=1;i<=y;i++) printf a[i] RS}'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to count lines - ignoring blank lines and commented lines

What is the command to count lines in a files, but ignore blank lines and commented lines? I have a file with 4 sections in it, and I want each section to be counted, not including the blank lines and comments... and then totalled at the end. Here is an example of what I would like my... (6 Replies)
Discussion started by: kthatch
6 Replies

2. Shell Programming and Scripting

nawk-how count the number of occurances of a pattern, when don't know the pattern

I've written a script to count the total size of SAN storage LUNs, and also display the LUN sizes. From server to server, the LUNs sizes differ. What I want to do is count the occurances as they occur and change. These are the LUN sizes: 49.95 49.95 49.95 49.95 49.95 49.95 49.95 49.95... (2 Replies)
Discussion started by: cyber111
2 Replies

3. Shell Programming and Scripting

Count the number of occurrences of a pattern between each occurrence of a different pattern

I need to count the number of occurrences of a pattern, say 'key', between each occurrence of a different pattern, say 'lu'. Here's a portion of the text I'm trying to parse: lu S1234L_149_m1_vg.6, part-att 1, vdp-att 1 p-reserver IID 0xdb registrations: key 4156 4353 0000 0000 ... (3 Replies)
Discussion started by: slipstream
3 Replies

4. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

5. Shell Programming and Scripting

Multiple pattern matching using awk and getting count of lines

Hi , I have a file which has multiple rows of data, i want to match the pattern for two columns and if both conditions satisfied i have to add the counter by 1 and finally print the count value. How to proceed... I tried in this way... awk -F, 'BEGIN {cnt = 0} {if $6 == "VLY278" &&... (6 Replies)
Discussion started by: aemunathan
6 Replies

6. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

7. UNIX for Advanced & Expert Users

Count number of lines between a pattern in a large file

1000CUS E Y4NYRETAIL 10010004HELIOPOLIS 110000500022360591000056XX EG 1101DEBY XXAD ZSSKY TSSROS 1102HANYNNYY@HOTMAIL.COM 210030/05/201301/06/2013AED 3100 OPE 3100 CLO 3100 The 1000CUS E Y NYCORPORATE 10010004HELIOPOLIS 110000500025270504550203XX EG 1101XXXQ FOR CTING AND... (1 Reply)
Discussion started by: john2022
1 Replies

8. Shell Programming and Scripting

Identify file pattern, take count of pattern, then act

Guys - Need your ideas on a section of code to finish something up. To make a long story short, I'm parsing a print output file that goes to pre-printed forms. I'm intercepting it, parsing it, formatting it, cutting it up into individual pages, grabbing the text I want in zones, building an... (3 Replies)
Discussion started by: ampsys
3 Replies

9. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

10. Shell Programming and Scripting

[sed] Finding and sticking the pattern to the beginning of successive lines up to the next pattern

I have a file like below. 2018.07.01, Sunday 09:27 some text 123456789 0 21 0.06 0.07 0.00 2018.07.02, Monday 09:31 some text 123456789 1 41 0.26 0.32 0.00 09:39 some text 456789012 1 0.07 0.09 0.09 09:45 some text 932469494 1 55 0.29 0.36 0.00 16:49 some text 123456789 0 48 0.12 0.15 0.00... (9 Replies)
Discussion started by: father_7
9 Replies
STATCVS(1)						      General Commands Manual							STATCVS(1)

NAME
statcvs - CVS Repository statistic analysis tool, written in Java SYNOPSIS
cvs log > cvs-logfile.log statcvs [ options ] path/to/cvs-logfile.log path/to/checkout DESCRIPTION
This manual page documents briefly the statcvs command. This manual page was written for the Debian distribution because the original pro- gram does not have a manual page. statcvs is a program that retrieves information from a CVS repository and generates various tables and charts describing the project devel- opment, e.g. timeline for the lines of code, contribution of each developer etc. The current version of StatCvs generates a static suite of HTML documents containing tables and chart images. StatCvs is opens source software, released under the terms oft the LGPL. StatCvs uses JFreeChart to generate charts. cvs-logfile.log path to the cvs logfile of the module. Important note: statcvs will fail if the log file was not produced with cvs from within the checkout. It however does not matter if the file is not in the directory you're running statcvs from. path/to/checkout path to the directory of the checked out module OPTIONS
These programs follow the usual command line syntax, with long options starting with one dashe ("-"). A list of options is included below. For a complete description, run the program without parameters -version print the version information and exit -output-dir <dir> directory where HTML suite will be saved -include <pattern> include only files matching pattern, e.g. **/*.c;**/*.h -exclude <pattern> exclude matching files, e.g. tests/**;docs/** -title <title> Project title to be used in reports -viewcvs <url> integrate with ViewCVS installation at <url> -verbose print extra progress information JAVA-WRAPPERS NOTE This program is a shell script wrapper based on java-wrappers(7). You therefore benefit from several features; please see the java-wrap- pers(7) manual page. SEE ALSO
cvs(1) and java-wrappers(7) AUTHOR
This manual page was written by Christian Bayle <bayle@debian.org>, for the Debian project (but may be used by others). juillet 20, 2003 STATCVS(1)
All times are GMT -4. The time now is 05:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy