09-28-2012
Tnx Don Cragun for your consideration.
I am working with huge bam files which I need to parse and do some analysis on them. Since they are so huge and I'm not expert in programming I analyse them step by stem and using pipe function to go to next step.
The data that I have so far has 4 column which the first column is just two different values for all lines. what I wanna do is to report the second column and the number of its repeats in a separate column. and then the corresponding value on 4th column which is the same for similar values in column 2.
I managed to do it by using two scripts. I'm just wondering if its possible to do in one single script. So Then I can use the output I have so far as an input using pipe.
Thanks.
---------- Post updated at 05:29 PM ---------- Previous update was at 05:26 PM ----------
Thanks Scrutinizer
I haven't applied what you wrote yet. But it needs an input file right? Is it possible to modify it to be able to use this script for the output of another script as I mentioned?
The only thing I know to do such things like that is pipe function. If there is any other way let me know plz.
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }'
I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ".
Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies
2. Shell Programming and Scripting
This may just be a lack of experience talking, but I always assumed that when possible it was better to use a commands built in abilities rather than to pipe to a bunch of commands. I wrote a (very simple) script a while back that was meant to pull out a certain error code, and report back what... (4 Replies)
Discussion started by: DeCoTwc
4 Replies
3. UNIX for Dummies Questions & Answers
uname -a
SunOS mypc 5.10 Generic_141414-07 sun4v sparc SUNW,SPARC-Enterprise-T2000
uname -a
SunOS mypc 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220
find . -name "*.cer" -exec keytool -v -list -printcert -file {} \; | grep -i "Aug 03"
Valid from: Mon Jan 29 00:00:00 GMT... (16 Replies)
Discussion started by: shifahim
16 Replies
4. Shell Programming and Scripting
Hi!
If I'm trying something like:
echo "hello world" | myvar=`awk -F "world" '{print $1}'`
echo $myvar
myvar is always empty :confused:
I googled for houres now and don't understand why it isn't working...
Trying it in normal bash.
Can someone explain it to me so I can say "Of course!... (8 Replies)
Discussion started by: al0x
8 Replies
5. Programming
I am trying to write a shell script for Linux to print the names of all non empty pipes in the current directory?
any help (3 Replies)
Discussion started by: nimesh
3 Replies
6. Shell Programming and Scripting
<tr><th align=right valign=top>Faulty_Part</th><td align=left valign=top>readhat version 6.0</td></tr> <tr><th align=right valign=top>Submit_Date</th><td align=left valign=top>2011-04-28 02:08:02</td></tr> .......(a long string)
I want to get all the field between "left valign=top>" and "... (2 Replies)
Discussion started by: yanglei_fage
2 Replies
7. Shell Programming and Scripting
Hello all,
quick question:
is it possible to pass input into AWK BOTH with a pipe AND a file at the same time, something like this:
command .......|awk '.................' FILEIN > fileout
All I read says either one or the other, not both, is it at all possible?
And how would the... (2 Replies)
Discussion started by: gio001
2 Replies
8. Shell Programming and Scripting
cat file |grep -v "xx" | grep -v "yy" |grep -v "zz" (3 Replies)
Discussion started by: yanglei_fage
3 Replies
9. Shell Programming and Scripting
In the below awk to add a sort by smallest to largest should it be added after the END? Thank you :).
BEGIN {
FS="*"
}
# Read search terms from file1 into 's'
FNR==NR {
s
next
}
{
# Check if $5 matches one of the search terms
for(i in s) {
if($5 ~ i) {
... (4 Replies)
Discussion started by: cmccabe
4 Replies
10. Red Hat
Hi all,
as i have multiple broken pipes on ssh sessions,
i need to find out after how much time it happens,
ssh root@testServer
root@testServer's password:
ssh:notty
Last login: Thu Apr 6 06:41:16 2017 from 10.10.10.2
#
but when broke pipe happen i don't have any idea after how much... (3 Replies)
Discussion started by: charli1
3 Replies