Sponsored Content
Top Forums Shell Programming and Scripting Calculating an integer with awk Post 302587714 by sdf on Thursday 5th of January 2012 05:35:25 PM
Old 01-05-2012
@corona688, what would the ideal code be to strip out the number from this html code? Thanks for the hint on the modulus operator %.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calculating totals in AWK

Hello, With the following small script I list the size of documents belonging to a certain user by each time selecting the bytes-field of that file ($7). Now it fills the array with every file it finds so in the end the output of some users contains up to 200.000 numbers. So how can I calculate... (7 Replies)
Discussion started by: Hille
7 Replies

2. Shell Programming and Scripting

reading and calculating no. of occurrence in awk

:confused:Hi, I have got results from my simulation and I did extract the time field from the results file into new file. Then I was trying to calculate no. of occurrence for each set of time. However, I couldn't. For example : 0.2 -- 0.2 -- 0.21016 -- 0.21016 -- 0.21016 -- . . .... (12 Replies)
Discussion started by: ENG_MOHD
12 Replies

3. Shell Programming and Scripting

Awk program for calculating dates.

Hi All, I have a txt file which has hundreds of lines and 41 fields. I have a requirement to pick up field 14 from the text file which is a date fiels in the following format. Field 14 : Data Type : NUMERIC DATE (YYYYMMDD) Field Length : 8 Example of Data :20090415 Field 42 : Data Type... (2 Replies)
Discussion started by: nua7
2 Replies

4. Shell Programming and Scripting

[Solved] awk calculating between lines

Hey guys, maybe you can help me with this... I want to read input.dat line by line, while doing a simple calculation between the second column value of the current line and the second column value of the next line (like a difference). input is something like this: 0 3.945757 1 ... (1 Reply)
Discussion started by: origamisven
1 Replies

5. Shell Programming and Scripting

AWK way of calculating growth

Hi All, IS there any 'awk' way to manipulate following data? Fruit Date Count Apple 20/08/2011 5 Apple 27/08/2011 7 Apple 05/09/2011 11 Apple 12/09/2011 3 Apple 19/09/2011 25 . . . . Orange 20/08/2011 9 Orange 27/08/2011 20 Orange 27/08/2011 7 Orange 05/09/2011 15 Orange... (3 Replies)
Discussion started by: aniketdixit
3 Replies

6. Shell Programming and Scripting

Calculating the epoch time from standard time using awk and calculating the duration

Hi All, I have the following time stamp data in 2 columns Date TimeStamp(also with milliseconds) 05/23/2012 08:30:11.250 05/23/2012 08:30:15.500 05/23/2012 08:31.15.500 . . etc From this data I need the following output. 0.00( row1-row1 in seconds) 04.25( row2-row1 in... (5 Replies)
Discussion started by: ks_reddy
5 Replies

7. Shell Programming and Scripting

Calculating average with awk

I need to find the average from a file like: data => BW:123 M:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0' data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0' data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0' data => BW:123 N:30 RTD:0 1 0 1 0 0 1 1 1 1 0 0 1 1 0' data => BW:123 N:30 RTD:0 1... (4 Replies)
Discussion started by: Slagle
4 Replies

8. Shell Programming and Scripting

Calculating Running Variance Using Awk

Hi all, I am attempting to calculate a running variance for a file containing a column of numbers. I am using the formula variance=sum((x-mean(x))^2)/(n-1), where x is the value on the current row, and mean(x) is the average of all of the values up until that row. n represents the total number... (1 Reply)
Discussion started by: Jahn
1 Replies

9. UNIX for Dummies Questions & Answers

Calculating cumulative frequency using awk

Hi, I wanted to calculate cumulative frequency distribution of my data that involves several arithmetic calls. I did things in excel but its taking me forever. this is what I want to do: var1.txt contains n observations which I have to compute for frequency which is given by 1/n and subsequently... (7 Replies)
Discussion started by: ida1215
7 Replies

10. UNIX for Beginners Questions & Answers

Calculating correlations across columns in awk

Hello, I came across a previous thread "awk-calculating-simple-correlation-rows" which calculated correlations across rows in awk. Code: awk '{ a = 0; for (i = 2; i <= NF; ++i) a += $i; a /= NF-1 b = 0; for (i = 2; i <= NF; ++i) b += ($i - a) ^ 2; b = sqrt(b) if... (7 Replies)
Discussion started by: Ross
7 Replies
QTranslatorMessage(3qt) 												   QTranslatorMessage(3qt)

NAME
QTranslatorMessage - Translator message and its properties SYNOPSIS
#include <qtranslator.h> Public Members QTranslatorMessage () QTranslatorMessage ( const char * context, const char * sourceText, const char * comment, const QString & translation = QString::null ) QTranslatorMessage ( QDataStream & stream ) QTranslatorMessage ( const QTranslatorMessage & m ) QTranslatorMessage & operator= ( const QTranslatorMessage & m ) uint hash () const const char * context () const const char * sourceText () const const char * comment () const void setTranslation ( const QString & translation ) QString translation () const enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText, HashContextSourceTextComment } void write ( QDataStream & stream, bool strip = FALSE, Prefix prefix = HashContextSourceTextComment ) const Prefix commonPrefix ( const QTranslatorMessage & m ) const bool operator== ( const QTranslatorMessage & m ) const bool operator!= ( const QTranslatorMessage & m ) const bool operator< ( const QTranslatorMessage & m ) const bool operator<= ( const QTranslatorMessage & m ) const bool operator> ( const QTranslatorMessage & m ) const bool operator>= ( const QTranslatorMessage & m ) const DESCRIPTION
The QTranslatorMessage class contains a translator message and its properties. This class is of no interest to most applications. It is useful for translation tools such as Qt Linguist. It is provided simply to make the API complete and regular. For a QTranslator object, a lookup key is a triple (context, source text, comment) that uniquely identifies a message. An extended key is a quadruple (hash, context, source text, comment), where hash is computed from the source text and the comment. Unless you plan to read and write messages yourself, you need not worry about the hash value. QTranslatorMessage stores this triple or quadruple and the relevant translation if there is any. See also QTranslator, Environment Classes, and Internationalization with Qt. Member Type Documentation QTranslatorMessage::Prefix Let (h, c, s, m) be the extended key. The possible prefixes are QTranslatorMessage::NoPrefix - no prefix QTranslatorMessage::Hash - only (h) QTranslatorMessage::HashContext - only (h, c) QTranslatorMessage::HashContextSourceText - only (h, c, s) QTranslatorMessage::HashContextSourceTextComment - the whole extended key, (h, c, s, m) See also write() and commonPrefix(). MEMBER FUNCTION DOCUMENTATION
QTranslatorMessage::QTranslatorMessage () Constructs a translator message with the extended key (0, 0, 0, 0) and QString::null as translation. QTranslatorMessage::QTranslatorMessage ( const char * context, const char * sourceText, const char * comment, const QString & translation = QString::null ) Constructs an translator message with the extended key (h, context, sourceText, comment), where h is computed from sourceText and comment, and possibly with a translation. QTranslatorMessage::QTranslatorMessage ( QDataStream & stream ) Constructs a translator message read from the stream. The resulting message may have any combination of content. See also QTranslator::save(). QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage & m ) Constructs a copy of translator message m. const char * QTranslatorMessage::comment () const Returns the comment for this message (e.g. "File|Save"). Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage & m ) const Returns the widest lookup prefix that is common to this translator message and to message m. For example, if the extended key is for this message is (71," PrintDialog", "Yes", "Print?") and that for m is (71," PrintDialog", "No", "Print?"), this function returns HashContext. See also write(). const char * QTranslatorMessage::context () const Returns the context for this message (e.g. "MyDialog"). uint QTranslatorMessage::hash () const Returns the hash value used internally to represent the lookup key. This value is zero only if this translator message was constructed from a stream containing invalid data. The hashing function is unspecified, but it will remain unchanged in future versions of Qt. bool QTranslatorMessage::operator!= ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is different from that of m; otherwise returns FALSE. bool QTranslatorMessage::operator< ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is lexicographically before than that of m; otherwise returns FALSE. bool QTranslatorMessage::operator<= ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is lexicographically before that of m or if they are equal; otherwise returns FALSE. QTranslatorMessage &; QTranslatorMessage::operator= ( const QTranslatorMessage & m ) Assigns message m to this translator message and returns a reference to this translator message. bool QTranslatorMessage::operator== ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is equal to that of m; otherwise returns FALSE. bool QTranslatorMessage::operator> ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is lexicographically after that of m; otherwise returns FALSE. bool QTranslatorMessage::operator>= ( const QTranslatorMessage & m ) const Returns TRUE if the extended key of this object is lexicographically after that of m or if they are equal; otherwise returns FALSE. void QTranslatorMessage::setTranslation ( const QString & translation ) Sets the translation of the source text to translation. See also translation(). const char * QTranslatorMessage::sourceText () const Returns the source text of this message (e.g. "&Save"). QString QTranslatorMessage::translation () const Returns the translation of the source text (e.g., "&Sauvegarder"). See also setTranslation(). void QTranslatorMessage::write ( QDataStream & stream, bool strip = FALSE, Prefix prefix = HashContextSourceTextComment ) const Writes this translator message to the stream. If strip is FALSE (the default), all the information in the message is written. If strip is TRUE, only the part of the extended key specified by prefix is written with the translation (HashContextSourceTextComment by default). See also commonPrefix(). SEE ALSO
http://doc.trolltech.com/qtranslatormessage.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, 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 (qtranslatormessage.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QTranslatorMessage(3qt)
All times are GMT -4. The time now is 07:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy