Sponsored Content
Top Forums Shell Programming and Scripting Help in awk to read the common txt Post 302732205 by Don Cragun on Friday 16th of November 2012 08:54:55 PM
Old 11-16-2012
1st: Note that you're splitting lines on "=" characters and that the array sum[] is the sum of the numeric value of last field on corresponding lines from each file.

2nd: Note that the lines you've marked in red (plus the two lines following them) have no "=" characters.

If you change the ":" characters on those lines in both input files to "=" characters, you get:
Code:
Sample Count  = 0 0 0
nPU weighted   = 441063 441530 882593
Pass vtx trk   = 442356 442358 884714
GenLevel       = 0 0 0
Pass   HLT     = 442356 442358 884714
   eff = inf 0.00493042 0.812471 inf 0.00483545 0.804582 inf
          = === === === === 0
 Pass Spike cut       = 649724 648483 1298207
 Pass Eta cut         = 623956 622832 1246788
 Pass Pt cut          = 185356 184933 370289
Pass EleID     = 60081 59976 120057
Passed DiLep   = 2181 2139 4320
   eff = inf 0.00493042 0.812471 inf 0.00483545 0.804582 inf
Pass Z mass    = 1865 1813 3678
 Fail GenEle match = 117 115 232
Passed Zs      = 1772 1721 3493
   eff = inf 0.00493042 0.812471 inf 0.00483545 0.804582 inf
Passed ZsW     = 8.10845e+06 8.03766e+06 16146110
Passed ZsW2    = 0 0 0
Sum LepID      = 7.99145e+07 7.76145e+07 157529000
Sum Pileup     = 7.95332e+07 7.88391e+07 158372300
          = === === === === 0
Spike                                      = 2089 2077 4166
pt                                          = 1281 1304 2585
pt, eta                                     = 1169 1198 2367
dR                                          = 1080 1095 2175
EleVeto                                     = 1029 1038 2067
EleVeto, HoE                                = 752 729 1481
EleVeto, HoE, sie                           = 197 199 396
EleVeto, HoE, sie, ChargdHad                = 10 12 22
EleVeto, HoE, sie, ChargdHad, NeuHad        = 9 9 18
EleVeto, HoE, sie, ChargdHad, NeuHad, phopf = 8 8 16
----------------------------------------------------------= ---------------------------------------------------------- ---------------------------------------------------------- 0
PhoID pass events = 8 8 16
Passed events  = 7 8 15
  eff = 0.00395034 0.00464846 0.0085988
Passed PU evt  = 7.40527 6.24361 13.6489

which I am guessing is closer to what you expected.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

want to read txt fileline by line

Hi , i want to read a text file line by line , is there any unix command or utility for this ? please tell me how to use it also ? (2 Replies)
Discussion started by: dharmesht
2 Replies

2. UNIX for Dummies Questions & Answers

How to read last line of a txt file?

I need to read the last file for a particular day, such as, "Jun 13" because the CSV file is cumulative for the entire day, so I don't want all the previous files, I just want the last file, for that day. I ran an 'ls -al | grep "June 13" > myLs.txt' (simplified) to list all files from that day.... (2 Replies)
Discussion started by: yongho
2 Replies

3. UNIX for Dummies Questions & Answers

How to read from txt file and use that as an array

Hi Guys How u all doing? I am having tough time to achieve this I have a unix .ksh script which calls sql script Right now I harcoded column id's in sql script but I want to read them from a txt file 1084,1143,1074,1080,1091,1090,1101,1069,1104,1087,1089,1081 I want to read this... (4 Replies)
Discussion started by: pinky
4 Replies

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

5. Shell Programming and Scripting

sed to read x.txt and grep from y.txt

How would I write a command(s) to read from a file (list) that looks like this: 29847374384 and grep from a second file (list) that looks like this: 29847374384, jkdfkjdf,3833,ddd:confused: (1 Reply)
Discussion started by: smellylizzard
1 Replies

6. UNIX for Dummies Questions & Answers

can't read a .txt file

Hello, I have a set of .txt files I cannot read. This is a part of what I see. Is there a way to view these files? _MO<P.6D@K;WU<B$X-;)SIV/ROO!UL+1P=VTT-?,SLC`MI/6QMS#UYGGT\+)C=#\UIO`TL/0]=#/T) it's about 3 pages. Thanks for your help. Joe (3 Replies)
Discussion started by: rcracerjoe
3 Replies

7. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

8. UNIX for Dummies Questions & Answers

How to join 2 .txt files based on a common column?

Hi all, I'm trying to join two .txt file tab delimitated based on a common column. File 1 transcript_id gene_id length effective_length expected_count TPM FPKM IsoPct comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00 comp1000297_c0_seq1 ... (1 Reply)
Discussion started by: alisrpp
1 Replies

9. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

10. Shell Programming and Scripting

Awk, sed, shell all words in INPUT.txt find in column1 of TABLE.txt and replce with column2 in

Hi dears i have text file like this: INPUT.txt 001_1_173 j nuh ]az 001_1_174 j ]esma. nuh ]/.xori . . . and have another text like this TABLE.txt j j nuh word1... (6 Replies)
Discussion started by: alii
6 Replies
CLOG(3) 						   BSD Library Functions Manual 						   CLOG(3)

NAME
clog -- complex logarithm function SYNOPSIS
#include <complex.h> double complex clog(double complex z); long double complex clogl(long double complex z); float complex clogf(float complex z); DESCRIPTION
clog(z) returns the complex logarithm of z. clog(conj(z)) = conj(clog(z)), for all complex floating-point numbers z. SPECIAL VALUES
The conjugate symmetry of clog() is used to abbreviate the specification of special values. clog(-0 + 0i) returns -inf + Pi i and raises the divide-by-zero flag. clog(0 + 0i) returns -inf + 0i and raises the divide-by-zero flag. clog(x + inf i) returns inf + Pi/2 i, for finite x. clog(x + NaN i) returns NaN + NaN i. clog(-inf + yi) returns inf + Pi i, for finite positive y. clog(inf + yi) returns inf + 0i, for finite positive y. clog(-inf + inf i) returns inf + 3Pi/4 i. clog(inf + inf i) returns inf + Pi/4 i. clog(+-inf + NaN i) returns inf + NaN i. clog(NaN + yi) returns NaN + NaN i, for finite y. clog(NaN + inf i) returns inf + NaN i. clog(NaN + NaN i) returns NaN + NaN i. NOTES
SEE ALSO
cexp(3) log(3) complex(3) STANDARDS
The clog() function conforms to ISO/IEC 9899:2011. 4th Berkeley Distribution December 11, 2006 4th Berkeley Distribution
All times are GMT -4. The time now is 10:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy