Sponsored Content
Full Discussion: awk Format
Top Forums Shell Programming and Scripting awk Format Post 302882284 by greycells on Monday 6th of January 2014 01:41:44 AM
Old 01-06-2014
Thx ...but its not working ....for example when looking for 0A71 in file 2 , $8 is (M)
so i need $1 from following

Code:
0A71 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (M) RW  214988
0A72 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (m) RW       -
0A73 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (m) RW       -
0A74 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (m) RW       -
0A75 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (m) RW       -
0A76 Not Visible            ***:*  NA:NA  RDF1+TDEV     N/Grp'd  (m) RW       -

If $8 = (M) , print $1 till $NF !~ "-"

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

data format from (4.56 0.7) -> 4.6(7) awk?!

Hi, I have to manipulate a data file which say reads like this {$index $value $error_on_value} aa 4.56 0.7 bb 123.456 0.00987 cc 987654 321 . . in easily human readable format of type aa 4.6(7) bb 123.456(1) cc 9.877(3)e+05 value rounded to 4.6 with error of 0.7 on the last... (4 Replies)
Discussion started by: ahan
4 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. Shell Programming and Scripting

How to format columns using AWK

Hi, How to format something like this: John Roberts 324-141-984 Acct Jack Williams 159-555-555 Acct William Jackson 949-911-888 Acct Mark J Walton 145-852-252 Acct Fred P Milton 483-244-390 Acct Bill P J Miller 404-050-223 Acct into... (12 Replies)
Discussion started by: ora_umair
12 Replies

4. Shell Programming and Scripting

scripting/awk help : awk sum output is not comming in regular format. Pls advise.

Hi Experts, I am adding a column of numbers with awk , however not getting correct output: # awk '{sum+=$1} END {print sum}' datafile 2.15291e+06 How can I getthe output like : 2152910 Thank you.. # awk '{sum+=$1} END {print sum}' datafile 2.15079e+06 (3 Replies)
Discussion started by: rveri
3 Replies

5. Shell Programming and Scripting

awk:How to format a number?

Hello, I need to format a number..like 12900 should be printed as 12,900 and 1209 as 1,209 and so on. (Just like we do in excel). Can this be done in awk. any printf options we have?Please suggest me. Thanks! (8 Replies)
Discussion started by: vijay_0209
8 Replies

6. Shell Programming and Scripting

Format in AWK please

Am new to AWk, Can anyone help me to get excepected output from given input please. input file student: name details of them = details_needed class: 5th_needed adress: address_needed Expected output: details of them = 5th_needed = address_needed ---------- Post updated at... (5 Replies)
Discussion started by: Elavarasan
5 Replies

7. Shell Programming and Scripting

Format using AWK

Need some help .. in formating some input INPUT FILE IMAGE ap00m43 0 0 8 ap00m43_1318914034 UNIX_STANDARD_ADC_2 0 *NULL* root Daily 1 0 1318914034 408 1319518834 0 HISTO -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 FRAG 1 1 0 0 2 20 6 G11890 ts00p71 65536 FRAG 1 2 13440 0 2 20 7 G11890 ts00p71... (2 Replies)
Discussion started by: greycells
2 Replies

8. UNIX for Dummies Questions & Answers

Solaris8 = How to format this df -k | awk

Hi, Unfortunately, we still have Solaris 8 to support and it does not support df -h so I am stucked with having to use df -k. UNIX shell is ksh. Example of df -k run is below: $ df -k /db/test01 | awk '{ print }' Filesystem kbytes used avail capacity Mounted on... (2 Replies)
Discussion started by: newbie_01
2 Replies

9. Shell Programming and Scripting

Format a file using awk

I have a file as below empty May7 noread May8 How can process this file and print as below. neat and clean. Filename Date Created empty May7 noread May8 I tried something with printf before creating the file itself... (3 Replies)
Discussion started by: Tuxidow
3 Replies

10. Shell Programming and Scripting

awk incorrect format

I was wondering whether anyone has any idea what is happening here. I'm using simple code to compare 2 tab delimited files based on column 1 values. If the column1 value of file1 exists in file2, then I'm to print the column4 value in file2 in column3 of file1. Here is my code: 1st I have to... (6 Replies)
Discussion started by: Geneanalyst
6 Replies
QListViewItemIterator(3qt)												QListViewItemIterator(3qt)

NAME
QListViewItemIterator - Iterator for collections of QListViewItems SYNOPSIS
#include <qlistview.h> Public Members enum IteratorFlag { Visible = 0x00000001, Invisible = 0x00000002, Selected = 0x00000004, Unselected = 0x00000008, Selectable = 0x00000010, NotSelectable = 0x00000020, DragEnabled = 0x00000040, DragDisabled = 0x00000080, DropEnabled = 0x00000100, DropDisabled = 0x00000200, Expandable = 0x00000400, NotExpandable = 0x00000800, Checked = 0x00001000, NotChecked = 0x00002000 } QListViewItemIterator () QListViewItemIterator ( QListViewItem * item ) QListViewItemIterator ( QListViewItem * item, int iteratorFlags ) QListViewItemIterator ( const QListViewItemIterator & it ) QListViewItemIterator ( QListView * lv ) QListViewItemIterator ( QListView * lv, int iteratorFlags ) QListViewItemIterator & operator= ( const QListViewItemIterator & it ) ~QListViewItemIterator () QListViewItemIterator & operator++ () const QListViewItemIterator operator++ ( int ) QListViewItemIterator & operator+= ( int j ) QListViewItemIterator & operator-- () const QListViewItemIterator operator-- ( int ) QListViewItemIterator & operator-= ( int j ) QListViewItem * operator* () QListViewItem * current () const DESCRIPTION
The QListViewItemIterator class provides an iterator for collections of QListViewItems. Construct an instance of a QListViewItemIterator, with either a QListView* or a QListViewItem* as argument, to operate on the tree of QListViewItems, starting from the argument. A QListViewItemIterator iterates over all the items from its starting point. This means that it always makes the first child of the current item the new current item. If there is no child, the next sibling becomes the new current item; and if there is no next sibling, the next sibling of the parent becomes current. The following example creates a list of all the items that have been selected by the user, storing pointers to the items in a QPtrList: QPtrList<QListViewItem> lst; QListViewItemIterator it( myListView ); while ( it.current() ) { if ( it.current()->isSelected() ) lst.append( it.current() ); ++it; } An alternative approach is to use an IteratorFlag: QPtrList<QListViewItem> lst; QListViewItemIterator it( myListView, QListViewItemIterator::Selected ); while ( it.current() ) { lst.append( it.current() ); ++it; } A QListViewItemIterator provides a convenient and easy way to traverse a hierarchical QListView. Multiple QListViewItemIterators can operate on the tree of QListViewItems. A QListView knows about all iterators operating on its QListViewItems. So when a QListViewItem gets removed all iterators that point to this item are updated and point to the following item if possible, otherwise to a valid item before the current one or to 0. Note however that deleting the parent item of an item that an iterator points to is not safe. See also QListView, QListViewItem, and Advanced Widgets. Member Type Documentation QListViewItemIterator::IteratorFlag These flags can be passed to a QListViewItemIterator constructor (OR-ed together if more than one is used), so that the iterator will only iterate over items that match the given flags. QListViewItemIterator::Visible QListViewItemIterator::Invisible QListViewItemIterator::Selected QListViewItemIterator::Unselected QListViewItemIterator::Selectable QListViewItemIterator::NotSelectable QListViewItemIterator::DragEnabled QListViewItemIterator::DragDisabled QListViewItemIterator::DropEnabled QListViewItemIterator::DropDisabled QListViewItemIterator::Expandable QListViewItemIterator::NotExpandable QListViewItemIterator::Checked QListViewItemIterator::NotChecked MEMBER FUNCTION DOCUMENTATION
QListViewItemIterator::QListViewItemIterator () Constructs an empty iterator. QListViewItemIterator::QListViewItemIterator ( QListViewItem * item ) Constructs an iterator for the QListView that contains the item. The current iterator item is set to point to the item. QListViewItemIterator::QListViewItemIterator ( QListViewItem * item, int iteratorFlags ) Constructs an iterator for the QListView that contains the item using the flags iteratorFlags. The current iterator item is set to point to item or the next matching item if item doesn't match the flags. See also QListViewItemIterator::IteratorFlag. QListViewItemIterator::QListViewItemIterator ( const QListViewItemIterator & it ) Constructs an iterator for the same QListView as it. The current iterator item is set to point on the current item of it. QListViewItemIterator::QListViewItemIterator ( QListView * lv ) Constructs an iterator for the QListView lv. The current iterator item is set to point on the first child (QListViewItem) of lv. QListViewItemIterator::QListViewItemIterator ( QListView * lv, int iteratorFlags ) Constructs an iterator for the QListView lv with the flags iteratorFlags. The current iterator item is set to point on the first child (QListViewItem) of lv that matches the flags. See also QListViewItemIterator::IteratorFlag. QListViewItemIterator::~QListViewItemIterator () Destroys the iterator. QListViewItem * QListViewItemIterator::current () const Returns iterator's current item. Examples: QListViewItem * QListViewItemIterator::operator* () Dereference operator. Returns a reference to the current item. The same as current(). QListViewItemIterator &; QListViewItemIterator::operator++ () Prefix ++. Makes the next item the new current item and returns it. Returns 0 if the current item is the last item or the QListView is 0. const QListViewItemIterator QListViewItemIterator::operator++ ( int ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Postfix ++. Makes the next item the new current item and returns the item that was the current item. QListViewItemIterator &; QListViewItemIterator::operator+= ( int j ) Sets the current item to the item j positions after the current item. If that item is beyond the last item, the current item is set to 0. Returns the current item. QListViewItemIterator &; QListViewItemIterator::operator-- () Prefix --. Makes the previous item the new current item and returns it. Returns 0 if the current item is the first item or the QListView is 0. const QListViewItemIterator QListViewItemIterator::operator-- ( int ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Postfix --. Makes the previous item the new current item and returns the item that was the current item. QListViewItemIterator &; QListViewItemIterator::operator-= ( int j ) Sets the current item to the item j positions before the current item. If that item is before the first item, the current item is set to 0. Returns the current item. QListViewItemIterator &; QListViewItemIterator::operator= ( const QListViewItemIterator & it ) Assignment. Makes a copy of it and returns a reference to its iterator. SEE ALSO
http://doc.trolltech.com/qlistviewitemiterator.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 (qlistviewitemiterator.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QListViewItemIterator(3qt)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy