Sponsored Content
Top Forums Shell Programming and Scripting Compare a file with all others then print off data Post 302585819 by birei on Thursday 29th of December 2011 10:10:21 AM
Old 12-29-2011
Hi llcooljatt,

I'm afraid that you will have to give us more details.

I've tested your script but output is different, did you miss any step?
Code:
$ awk -F, 'NR==FNR{a[$1OFS$2OFS$3]++;next} a[$1OFS$2OFS$3]{b[$1OFS$2OFS$3]++} END{for(i in b){if(b[i]-1){print i";\t\t"b[i]}else{print "NEW:"i";\t\t1"} } }' OFS=, 20111228.csv *.csv | sort
NE:252848,SHELF:3,SLOT:5;               2
NE:267909,SHELF:4,SLOT:4;               2
NE:509033,SHELF:2,SLOT:1;               2
NE:565538,SHELF:7,SLOT:4;               2
NE:800189,SHELF:8,SLOT:3;               3
NE:825890,SHELF:5,SLOT:1;               2
NE:852991,SHELF:11,SLOT:4;              3
NEW:NE:220072,SHELF:6,SLOT:3;           1
NEW:NE:221478,SHELF:13,SLOT:4;          1
NEW:NE:221514,SHELF:14,SLOT:1;          1
NEW:NE:221726,SHELF:8,SLOT:1;           1
NEW:NE:222318,SHELF:14,SLOT:1;          1
NEW:NE:222799,SHELF:5,SLOT:2;           1
NEW:NE:230293,SHELF:6,SLOT:2;           1
NEW:NE:230478,SHELF:10,SLOT:6;          1
NEW:NE:239160,SHELF:15,SLOT:4;          1
NEW:NE:267909,SHELF:1,SLOT:6;           1
NEW:NE:509622,SHELF:12,SLOT:2;          1
NEW:NE:509860,SHELF:8,SLOT:3;           1
NEW:NE:541469,SHELF:11,SLOT:6;          1
NEW:NE:571528,SHELF:8,SLOT:2;           1
NEW:NE:593848,SHELF:3,SLOT:1;           1
NEW:NE:594728,SHELF:3,SLOT:5;           1
NEW:NE:597708,SHELF:12,SLOT:6;          1
NEW:NE:602306,SHELF:18,SLOT:6;          1
NEW:NE:602306,SHELF:6,SLOT:3;           1
NEW:NE:801048,SHELF:3,SLOT:1;           1
NEW:NE:801048,SHELF:6,SLOT:2;           1
NEW:NE:825890,SHELF:2,SLOT:4;           1
NEW:NE:826030,SHELF:8,SLOT:3;           1
NEW:NE:841068,SHELF:8,SLOT:4;           1
NEW:NE:854479,SHELF:6,SLOT:5;           1
NEW:NE:877073,SHELF:3,SLOT:3;           1
NEW:NE:895435,SHELF:5,SLOT:5;           1
NEW:NE:984177,SHELF:1,SLOT:4;           1
NEW:NE:993180,SHELF:3,SLOT:1;           1

Regards,
Birei
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Compare Data in the same file

Dear Unix-Gurus, I'm trying to write a script to compare the data in a log file. Here's how my logfile will look like: 'List All A0 Data in Destination Server' A0567 A0678 A0789 List A0 Files in Source Server A0567 A0678 A0789 So if the file match in Source Server match Destination... (1 Reply)
Discussion started by: lweegp
1 Replies

2. Shell Programming and Scripting

compare 2 file and print difference in the third file URG PLS

Hi I have two files in unix. I need to compare two files and print the differed lines in other file Eg file1 1111 2222 3333 file2 1111 2222 3333 4444 5555 newfile 4444 5555 Thanks In advance (3 Replies)
Discussion started by: evvander
3 Replies

3. Shell Programming and Scripting

Compare selected columns from a file and print difference

I have learned file comparison from my previous post here. Then, it is comparing the whole line. Now, i have a new problem. I have two files with 3 columns separated with a "|". What i want to do is to compare the second and third column of file 1, and the second and third column of file 2. And... (4 Replies)
Discussion started by: kingpeejay
4 Replies

4. Shell Programming and Scripting

compare two columns of different files and print the matching second file..

Hi, I have two tab separated files; file1: S.No ddi fi cu o/l t+ t- 1 0.5 0.6 o 0.1 0.2 2 0.2 0.3 l 0.3 0.4 3 0.5 0.8 l 0.1 0.6 ... (5 Replies)
Discussion started by: vasanth.vadalur
5 Replies

5. Shell Programming and Scripting

Compare two file and print same line

i want to compare two file and print same line file1 12345 a 23456 a 45678 a 45679 a file2 23456 a 34567 a 45679 a output 23456 a 45679 a any one can help me? Thank you (7 Replies)
Discussion started by: bleach8578
7 Replies

6. Shell Programming and Scripting

Compare and print out data only appear in file 1 problem

Below is the data content of file_1 and file_2: file_1 >sample_1 FKGJGPOPOPOQA ASDADWEEWERE ASDAWEWQWRW ASDASDASDASDD file_2 >sample_1 DRTOWPFPOPOQA ASDADWEEASDF ASDADRTYWRW ASDASDASDASDD I got try the following perl script. Unfortunately, it can't give my desired output result... (7 Replies)
Discussion started by: patrick87
7 Replies

7. UNIX for Dummies Questions & Answers

Compare 2 files print the lines of file 2 that contain a string from file 1

Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help File 1 123 232 W343... (6 Replies)
Discussion started by: KevinRidley
6 Replies

8. 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

9. Shell Programming and Scripting

Compare & print content of file which is not matching

Hi All I want to compare 2 files using awk and get output of content which is not matching I have 2 files a.txt 123 456 780 143 b.txt A|B|C|167|D|E C|K|D|123|D|E A|B|D|789|G|F C|D|G|143|A|B Not matching line from b.txt O/P A|B|C|167|D|E A|B|D|789|G|F (3 Replies)
Discussion started by: aaysa123
3 Replies

10. Shell Programming and Scripting

Compare 2 columns from the same file and print a value depending on the result

Hello Unix gurus, I have a file with this format (example values): label1 1 0 label2 1 0 label3 0.4 0.6 label4 0.5 0.5 label5 0.1 0.9 label6 0.9 0.1 in which: column 1 is a row label column 2 and 3 are values I would like to do a simple operation on this table and get the... (8 Replies)
Discussion started by: ksennin
8 Replies
QToolTipGroup(3qt)														QToolTipGroup(3qt)

NAME
QToolTipGroup - Collects tool tips into related groups SYNOPSIS
#include <qtooltip.h> Inherits QObject. Public Members QToolTipGroup ( QObject * parent, const char * name = 0 ) ~QToolTipGroup () bool delay () const bool enabled () const Public Slots void setDelay ( bool ) void setEnabled ( bool ) Signals void showTip ( const QString & longText ) void removeTip () Properties bool delay - whether the display of the group text is delayed bool enabled - whether tool tips in the group are enabled DESCRIPTION
The QToolTipGroup class collects tool tips into related groups. Tool tips can display two texts: one in the tip and (optionally) one that is typically in a status bar. QToolTipGroup provides a way to link tool tips to this status bar. QToolTipGroup has practically no API; it is only used as an argument to QToolTip's member functions, for example like this: QToolTipGroup * grp = new QToolTipGroup( this, "tool tip relay" ); connect( grp, SIGNAL(showTip(const QString&)), myLabel, SLOT(setText(const QString&)) ); connect( grp, SIGNAL(removeTip()), myLabel, SLOT(clear()) ); QToolTip::add( giraffeButton, "feed giraffe", grp, "Give the giraffe a meal" ); QToolTip::add( gorillaButton, "feed gorilla", grp, "Give the gorilla a meal" ); This example makes the object myLabel (which you must supply) display (one assumes, though you can make myLabel do anything, of course) the strings "Give the giraffe a meal" and "Give the gorilla a meal" while the relevant tool tips are being displayed. Deleting a tool tip group removes the tool tips in it. See also Help System. MEMBER FUNCTION DOCUMENTATION
QToolTipGroup::QToolTipGroup ( QObject * parent, const char * name = 0 ) Constructs a tool tip group called name, with parent parent. QToolTipGroup::~QToolTipGroup () Destroys this tool tip group and all tool tips in it. bool QToolTipGroup::delay () const Returns TRUE if the display of the group text is delayed; otherwise returns FALSE. See the "delay" property for details. bool QToolTipGroup::enabled () const Returns TRUE if tool tips in the group are enabled; otherwise returns FALSE. See the "enabled" property for details. void QToolTipGroup::removeTip () [signal] This signal is emitted when a tool tip in this group is hidden. See the QToolTipGroup documentation for an example of use. See also showTip(). void QToolTipGroup::setDelay ( bool ) [slot] Sets whether the display of the group text is delayed. See the "delay" property for details. void QToolTipGroup::setEnabled ( bool ) [slot] Sets whether tool tips in the group are enabled. See the "enabled" property for details. void QToolTipGroup::showTip ( const QString & longText ) [signal] This signal is emitted when one of the tool tips in the group is displayed. longText is the extra text for the displayed tool tip. See also removeTip(). Property Documentation bool delay This property holds whether the display of the group text is delayed. If set to TRUE (the default), the group text is displayed at the same time as the tool tip. Otherwise, the group text is displayed immediately when the cursor enters the widget. Set this property's value with setDelay() and get this property's value with delay(). bool enabled This property holds whether tool tips in the group are enabled. This property's default is TRUE. Set this property's value with setEnabled() and get this property's value with enabled(). SEE ALSO
http://doc.trolltech.com/qtooltipgroup.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 (qtooltipgroup.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QToolTipGroup(3qt)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy