Sponsored Content
Top Forums Shell Programming and Scripting Extract paragraphs and count them Post 302993657 by drysdalk on Monday 13th of March 2017 08:36:10 AM
Old 03-13-2017
Hi,

If these errors or warnings can only ever occur once per each section of your input file, then all you'd need to do is search for all instances of those errors or warnings and count how many you've found. That would then tell you how many sections contained these errors. If they can occur multiple times per section of course that would complicate things.

If you can provide information on what these error/warning messages in your input are expected to look like, and if they will only ever appear once per paragraph, that would be a good way forward for starters. As of just now you haven't actually said exactly what it is in the file that constitutes the warning/error that you're interested in.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to extract paragraphs from file in BASH script followed by prefix ! , !! and !!!

I]hi all i am in confusion since last 2 days :( i posted thraed yesterday and some friends did help but still i couldnt get solution to my problem let it be very clear i have a long log file of alkatel switch and i have to seperate the minor major and critical alarms shown by ! , !! and !!!... (6 Replies)
Discussion started by: nabmufti
6 Replies

2. Shell Programming and Scripting

how to filter out some paragraphs in a file

Hi, I am trying to filter out those paragraphs that contains 'CONNECT', 'alter system switch logfile'. That means say the input file is : ------------------------------------------------------- Wed Jun 7 00:32:31 2006 ACTION : 'CONNECT' CLIENT USER: prdadm CLIENT TERMINAL: Wed Jun 7... (7 Replies)
Discussion started by: cnlhap
7 Replies

3. Shell Programming and Scripting

How to extract specific data and count number containing sets from a file?

Hello everybody! I am quit new here and hope you can help me. Using an awk script I am trying to extract data from several files. The structure of the input files is as follows: TimeStep parameter1 parameter2 parameter3 parameter4 e.g. 1 X Y Z L 1 D H Z I 1 H Y E W 2 D H G F 2 R... (2 Replies)
Discussion started by: Daniel8472
2 Replies

4. Shell Programming and Scripting

Extract string from multiple file based on line count number

Hi, I search all forum, but I can not find solutions of my problem :( I have multiple files (5000 files), inside there is this data : FILE 1: 1195.921 -898.995 0.750312E-02-0.497526E-02 0.195382E-05 0.609417E-05 -2021.287 1305.479-0.819754E-02 0.107572E-01 0.313018E-05 0.885066E-05 ... (15 Replies)
Discussion started by: guns
15 Replies

5. Shell Programming and Scripting

Extract paragraphs under conditions

Hi all, I want to extract some paragraphs out of a file under certain conditions. - The paragraph must start with 'fmri' - The paragraph must contain the string 'restarter svc:/system/svc/restarter:default' My input is like that : fmri svc:/system/vxpbx:default state_time Wed... (4 Replies)
Discussion started by: Armoric
4 Replies

6. Shell Programming and Scripting

Need help with sorting in paragraphs

I am very new to shell scripting, current try to do a sorting of a text file in paragraphs with ksh script. example: File content: A1100001 line 1 = "testing" line 2 = something, line 3 = 100 D1200003 line 1 = "testing" line 2 = something, line 3 = 100 B1200003 line 1 =... (3 Replies)
Discussion started by: gavin_L
3 Replies

7. Shell Programming and Scripting

Extract and count number of Duplicate rows

Hi All, I need to extract duplicate rows from a file and write these bad records into another file. And need to have a count of these bad records. i have a command awk ' {s++} END { for(i in s) { if(s>1) { print i } } }' ${TMP_DUPE_RECS}>>${TMP_BAD_DATA_DUPE_RECS}... (5 Replies)
Discussion started by: Arun Mishra
5 Replies

8. Shell Programming and Scripting

Skip the delimiter with in double quotes and count the number of delimiters during data extract

Hi All, I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out. Below are the details: Delimited: | Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies

9. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

10. UNIX for Beginners Questions & Answers

Extract lines that have dupliucate and count them

Dear friends i have big file and i want to export the filw with new column for the lines that have same duplicate value in first column : ex : , ex : -bash-3.00$ cat INTCONT-IS.CSV M205-00-106_AMDRN:1-0-6-22,12-662-4833,intContact,2016-11-15 02:32:16,50... (9 Replies)
Discussion started by: is2_egypt
9 Replies
QSyntaxHighlighter(3qt) 												   QSyntaxHighlighter(3qt)

NAME
QSyntaxHighlighter - Base class for implementing QTextEdit syntax highlighters SYNOPSIS
#include <qsyntaxhighlighter.h> Inherits Qt. Public Members QSyntaxHighlighter ( QTextEdit * textEdit ) virtual ~QSyntaxHighlighter () virtual int highlightParagraph ( const QString & text, int endStateOfLastPara ) = 0 void setFormat ( int start, int count, const QFont & font, const QColor & color ) void setFormat ( int start, int count, const QColor & color ) void setFormat ( int start, int count, const QFont & font ) QTextEdit * textEdit () const void rehighlight () int currentParagraph () const DESCRIPTION
The QSyntaxHighlighter class is a base class for implementing QTextEdit syntax highlighters. A syntax highligher automatically highlights parts of the text in a QTextEdit. Syntax highlighters are often used when the user is entering text in a specific format (for example, source code) and help the user to read the text and identify syntax errors. To provide your own syntax highlighting for QTextEdit, you must subclass QSyntaxHighlighter and reimplement highlightParagraph(). When you create an instance of your QSyntaxHighlighter subclass, pass it the QTextEdit that you want the syntax highlighting to be applied to. After this your highlightParagraph() function will be called automatically whenever necessary. Use your highlightParagraph() function to apply formatting (e.g. setting the font and color) to the text that is passed to it. See also Basic Widgets and Text Related Classes. MEMBER FUNCTION DOCUMENTATION
QSyntaxHighlighter::QSyntaxHighlighter ( QTextEdit * textEdit ) Constructs the QSyntaxHighlighter and installs it on textEdit. It is the caller's responsibility to delete the QSyntaxHighlighter when it is no longer needed. QSyntaxHighlighter::~QSyntaxHighlighter () [virtual] Destructor. Uninstalls this syntax highlighter from the textEdit() int QSyntaxHighlighter::currentParagraph () const Returns the id of the paragraph which is highlighted, or -1 of no paragraph is currently highlighted. Usually this function is called from within highlightParagraph(). int QSyntaxHighlighter::highlightParagraph ( const QString & text, int endStateOfLastPara ) [pure virtual] This function is called when necessary by the rich text engine, i.e. on paragraphs which have changed. In your reimplementation you should parse the paragraph's text and call setFormat() as often as necessary to apply any font and color changes that you require. Your function must return a value which indicates the paragraph's end state: see below. Some syntaxes can have constructs that span paragraphs. For example, a C++ syntax highlighter should be able to cope with /*...*/ comments that span paragraphs. To deal with these cases it is necessary to know the end state of the previous paragraph (e.g. "in comment"). If your syntax does not have paragraph spanning constructs, simply ignore the endStateOfLastPara parameter and always return 0. Whenever highlightParagraph() is called it is passed a value for endStateOfLastPara. For the very first paragraph this value is always -2. For any other paragraph the value is the value returned by the most recent highlightParagraph() call that applied to the preceding paragraph. The value you return is up to you. We recommend only returning 0 (to signify that this paragraph's syntax highlighting does not affect the following paragraph), or a positive integer (to signify that this paragraph has ended in the middle of a paragraph spanning construct). To find out which paragraph is highlighted, call currentParagraph(). For example, if you're writing a simple C++ syntax highlighter, you might designate 1 to signify "in comment". For a paragraph that ended in the middle of a comment you'd return 1, and for other paragraphs you'd return 0. In your parsing code if endStateOfLastPara was 1, you would highlight the text as a C++ comment until you reached the closing */. void QSyntaxHighlighter::rehighlight () Redoes the highlighting of the whole document. void QSyntaxHighlighter::setFormat ( int start, int count, const QFont & font, const QColor & color ) This function is applied to the syntax highlighter's current paragraph (the text of which is passed to the highlightParagraph() function). The specified font and color are applied to the text from position start for count characters. (If count is 0, nothing is done.) void QSyntaxHighlighter::setFormat ( int start, int count, const QColor & color ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. void QSyntaxHighlighter::setFormat ( int start, int count, const QFont & font ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. QTextEdit * QSyntaxHighlighter::textEdit () const Returns the QTextEdit on which this syntax highlighter is installed SEE ALSO
http://doc.trolltech.com/qsyntaxhighlighter.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qsyntaxhighlighter.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QSyntaxHighlighter(3qt)
All times are GMT -4. The time now is 01:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy