Sponsored Content
Full Discussion: Comparing 2 huge text files
Top Forums Shell Programming and Scripting Comparing 2 huge text files Post 302523234 by ctsgnb on Wednesday 18th of May 2011 08:17:12 AM
Old 05-18-2011
@ygemici

I got the following error :
Code:
# nawk 'NR==FNR{if (/^uid:/) a[$2];next}{x=$0;sub("@.*","",x);if(!(x in a)) print $1}' f2 f1
nisha@SYSTEMS.NYFIX.COM
rdpena@SYSTEMS.NYFIX.COM
service/backups-ora@SYSTEMS.NYFIX.COM
ivanr@SYSTEMS.NYFIX.COM
nasapova@SYSTEMS.NYFIX.COM
tpulay@SYSTEMS.NYFIX.COM
rsueno@SYSTEMS.NYFIX.COM
peterd@SYSTEMS.NYFIX.COM
casehan@SYSTEMS.NYFIX.COM
akrapivi@SYSTEMS.NYFIX.COM
# egrep -v $(sed -n 's/uid: \(.*\)/\1/p' f2 | sed ':a N;s/\n/|/;ta') f1
Label too long: :a N;s/\n/|/;ta
# uname -a
SunOS <anonymized> 5.10 Generic_141414-01 sun4u sparc SUNW,Sun-Fire-V490
#

I got the same error with the semicolon before the N
Code:
# egrep -v $(sed -n 's/uid: \(.*\)/\1/p' f2  |sed ':a;N;s/\n/|/;ta') f1
Label too long: :a;N;s/\n/|/;ta

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

comparing text files

I am comparing text files where there are number of rows of numbers from window to unix box Is there any way of checking lets say 4 document of text file and seeing the difference only (or missing rows of numbers) with simple commands with lets say a batch file FROM ABSOULTE... (2 Replies)
Discussion started by: sjumma
2 Replies

2. Solaris

Huge (repeated Entry) text files

Somebody HELP! I have a huge log file (TEXT) 76298035 bytes. It's a logfile of IMEIs and IMSIS that I get from my EIR node. Here is how the contents of the file look like: 000000, 1 33016382000913 652020100423994 1 33016382002353 652020100430743 1 33017035101003 652020100441736... (4 Replies)
Discussion started by: axl
4 Replies

3. AIX

comparing within text files

hi! some looping problem here... i have a 2-column text file 4835021 20060903FAL0132006 4835021 20060904FAL0132006 4835021 20060905FAL0132006 4835023 20060903FAL0132006 4835023 20061001HAL0132006 4835023 ... (3 Replies)
Discussion started by: d3ck_tm
3 Replies

4. UNIX for Dummies Questions & Answers

comparing Huge Files - Performance is very bad

Hi All, Can you please help me in resolving the following problem? My requirement is like this: 1) I have two files YESTERDAY_FILE and TODAY_FILE. Each one is having nearly two million data. 2) I need to check each record of TODAY_FILE in YESTERDAY_FILE. If exists we can skip that by... (5 Replies)
Discussion started by: madhukalyan
5 Replies

5. Shell Programming and Scripting

Comparing two huge files

Hi, I have two files file A and File B. File A is a error file and File B is source file. In the error file. First line is the actual error and second line gives the information about the record (client ID) that throws error. I need to compare the first field (which doesnt start with '//') of... (11 Replies)
Discussion started by: kmkbuddy_1983
11 Replies

6. UNIX for Advanced & Expert Users

Best way to search for patterns in huge text files

I have the following situation: a text file with 50000 string patterns: abc2344536 gvk6575556 klo6575556 .... and 3 text files each with more than 1 million lines: ... 000000 abc2344536 46575 0000 000000 abc2344536 46575 4444 000000 abc2344555 46575 1234 ... I... (8 Replies)
Discussion started by: andy2000
8 Replies

7. Shell Programming and Scripting

comparing to text files

Hi All, I have two files of the following formats file 1 - this is a big file >AB_1 gi|229194403|ref|ZP_04321208.1| group II intron reverse transcriptase/maturase gdfjafhlkhlnlklaklskckcfhhahgfahajfkkallalfafafa >AB_2 gi|229194404|ref|ZP_04321209.1| gfksjgfkjsfjslfslfslhf >AB_3... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

8. Shell Programming and Scripting

Comparing two huge files on field basis.

Hi all, I have two large files and i want a field by field comparison for each record in it. All fields are tab seperated. file1: Email SELVAKUMAR RAMACHANDRAN Email SHILPA SAHU Web NIYATI SONI Web NIYATI SONI Email VIINII DOSHI Web RAJNISH KUMAR Web ... (4 Replies)
Discussion started by: Suman Singh
4 Replies

9. Shell Programming and Scripting

How to fix line breaks format text for huge files?

Hi, I need to correct line breaks for huge files (more than 1MM records in a file) and then format it properly. Except the header and trailer, each record starts with 'D'. Requirement:Scan the whole file except the header and trailer records and see if any of the records start with... (19 Replies)
Discussion started by: kikionline
19 Replies

10. Shell Programming and Scripting

Perl: Need help comparing huge files

What do i need to do have the below perl program load 205 million record files into the hash. It currently works on smaller files, but not working on huge files. Any idea what i need to do to modify to make it work with huge files: #!/usr/bin/perl $ot1=$ARGV; $ot2=$ARGV; open(mfileot1,... (12 Replies)
Discussion started by: mrn6430
12 Replies
SNMP-UPS(8)							    NUT Manual							       SNMP-UPS(8)

NAME
snmp-ups - Multi-MIB Driver for SNMP UPS equipment NOTE
This man page only documents the hardware-specific features of the snmp-ups driver. For information about the core driver, see nutupsdrv(8). SUPPORTED HARDWARE
The snmp-ups driver automatically detects and supports a wide range of devices by loading various MIBS: ietf:: UPS that is RFC 1628 (UPS MIB) compliant, e.g. MGE UPS SYSTEMS, Liebert, perhaps others (default) mge MGE UPS SYSTEMS and MGE Office Protection Systems devices with SNMP cards (ref 66062, 66045, 66074 and 66244) apcc APC AP9605, AP9606, AP9617, and AP9618 APC network management cards, as well as any others supporting the APC POWERNET MIB netvision Socomec Sicon UPS with Netvision Web/SNMP management card/external box pw Powerware devices with ConnectUPS SNMP cards aphel_genesisII Eaton Powerware ePDU Monitored aphel_revelation Eaton Powerware ePDU Managed raritan Various Raritan PDUs baytech Various BayTech PDUs cpqpower HP/Compaq AF401A management card, perhaps others cyberpower Cyberpower RMCARD201. Should also support RMCARD100 (net version), RMCARD202 and RMCARD301 EXTRA ARGUMENTS
This driver supports the following optional settings in the ups.conf(5): mibs=name Set MIB compliance (default=auto, allowed entries: refer to the above SUPPORTED HARDWARE). With "auto", the driver will try a select set of SNMP objects until it finds one that the device responds to. community=name Set community name (default = public). Note that you require a RW community name to change UPS settings (as for a powerdown). snmp_version=version Set SNMP version (default = v1, the other allowed value is v2c) pollfreq=value Set polling frequency in seconds, to reduce network flow (default=30) notransferoids Disable the monitoring of the low and high voltage transfer OIDs in the hardware. This will remove input.transfer.low and input.transfer.high from the list of variables. This should only be used on APCC Symmetra equipment which has strangeness in the three-phase power reporting. secLevel=value Set the securityLevel used for SNMPv3 messages (default=noAuthNoPriv, allowed: authNoPriv,authPriv) secName=value Set the securityName used for authenticated SNMPv3 messages (no default) authPassword=value Set the authentication pass phrase used for authenticated SNMPv3 messages (no default) privPassword=value Set the privacy pass phrase used for encrypted SNMPv3 messages (no default) authProtocol=value Set the authentication protocol (MD5 or SHA) used for authenticated SNMPv3 messages (default=MD5) privProtocol=value Set the privacy protocol (DES or AES) used for encrypted SNMPv3 messages (default=DES) REQUIREMENTS
You will need to install the Net-SNMP package from http://www.net-snmp.org/ before building this driver. SNMP v3 also requires OpenSSL support from http://www.openssl.org. LIMITATION
Shutdown This driver does not provide a proper upsdrv_shutdown() function. There probably never will be one, since at the time this script should run (near the end of the system halt script), there will be no network capabilities anymore. Probably the only way to shutdown an SNMP UPS is by sending it a shutdown with delay command through upscmd(8) and hope for the best that the system will have finished shutting down before the power is cut. INSTALLATION
This driver is only built if the Net-SNMP development files are present on the system. You can also force it to be built by using "configure --with-snmp=yes" before calling make. IMPLEMENTATION
The hostname of the UPS is specified with the "port" value in ups.conf, i.e.: [snmpv1] driver = snmp-ups port = snmp-ups.example.com community = public snmp_version = v1 mibs = ietf pollfreq = 15 desc = "Example SNMP v1 device" [snmpv3] driver = snmp-ups port = 166.99.224.132 mibs = mge secLevel = authPriv secName = mysecurityname authPassword = myauthenticationpassphrase privPassword = myprivatepassphrase desc = "Example SNMP v3 device, with the highest security level" AUTHORS
Arnaud Quette, Dmitry Frolov Sponsored by Eaton http://www.eaton.com and originally by MGE UPS SYSTEMS http://www.mgeups.com/ SEE ALSO
The core driver: nutupsdrv(8) NUT SNMP Protocols Library Available at: http://www.networkupstools.org/protocols/snmp/ Internet resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 SNMP-UPS(8)
All times are GMT -4. The time now is 02:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy