10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :).
f1
... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
In the tab delimited files below I am trying to match $2 in file1 to $2 of file2. If a match is found the awk checks $3 of file2 and if it is greater than 40% and $4 of file2 is greater than 49, the line in file1 is printed. In the desired output line3 of file1 is not printed because $3 off file2... (9 Replies)
Discussion started by: cmccabe
9 Replies
3. Shell Programming and Scripting
I am trying to combine all matching lines in the tab-delimited using awk. The below runs but no output results. Thank you :).
input
chrX 110925349 110925532 ALG13
chrX 110925349 110925532 ALG13
chrX 110925349 110925532 ALG13
chrX 47433390 47433999 SYN1... (3 Replies)
Discussion started by: cmccabe
3 Replies
4. UNIX for Dummies Questions & Answers
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
Thanks a lot.
Any help is appreciated.
Script I am using:
awk 'FNR == NR && ! /^]*$/ {... (9 Replies)
Discussion started by: High-T
9 Replies
5. Shell Programming and Scripting
Hi all,
I want to search for strings in file1 that can be found in file2 and print out the whole line when matching pattern is found.
I have used the below command, but this is not working for me, because it is writing out only the matching patterns from file2, not the whole line.
fgrep -o... (2 Replies)
Discussion started by: MonikaB
2 Replies
6. Shell Programming and Scripting
Hello,
I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies
7. Shell Programming and Scripting
My item was not answered on previous thread as code given did not work
I wanted to print records from file2 where comparing column 1 and 16 for both files find rows where column 16 in file 1 does not match column 16 in file 2
Here was CODE give to issue
~/unix.com$ cat f1... (0 Replies)
Discussion started by: sigh2010
0 Replies
8. Shell Programming and Scripting
Hello everyone,
I have a little script below:
die "Usage infile outfile reGex" if @ARGV != 3;
($regex) = @ARGV;
open(F,$ARGV) or die "Can't open";
open(FOUT,"+>$ARGV") or die "Can't open";
while (<F>)
{
print FOUT if /$regex/.../$regex/;
}
No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies
9. Shell Programming and Scripting
Hi folks
I am not allowed to install GNU grep on AIX.
Here my code excerpt:
grep_fatal () {
/usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP"
}
Howto the same on AIX based machine?
from manual GNU grep
‘--after-context=num’
Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies
10. Shell Programming and Scripting
Hi I have a very long file with 4 columns of numbers for example
1875 1876 12725 12723
13785 13786 4232 4230
13184 13185 ... (2 Replies)
Discussion started by: ananyob
2 Replies