Search Results

Search: Posts Made By: cs_novice
1,244
Posted By vgersh99
What have you tried so far and where exactly are...
What have you tried so far and where exactly are you stuck?
And how did you arrive at human man mammal in your desired output from the sample inputs you gave?
1,244
Posted By bakunin
As i suggested join i will explain how to use it....
As i suggested join i will explain how to use it. Some work will be left over for the reader and effort on thread-owners part to solve the problem will be appreciated. The following is a loose...
1,079
Posted By durden_tyler
$ $ cat file1.txt 1 2 3 4 5 6 7 ...
$
$ cat file1.txt
1
2
3
4
5
6
7
8
9
10
$
$ cat file2.txt
1 a
2 d
2 f
6 r
6 e
6 a
1,079
Posted By Yoda
join -a 1 -1 1 -2 1 file1.txt file2.txt | awk '...
join -a 1 -1 1 -2 1 file1.txt file2.txt | awk ' NR==1 {
printf "%s\t%s", $1, $2;
} p==$1 {
printf ",%s", $2;
} p!=$1 && NR!=1 {
...
1,079
Posted By radoulov
awk > file3 'NR == FNR { f2[$1] = $1 in f2 ?...
awk > file3 'NR == FNR {
f2[$1] = $1 in f2 ? f2[$1] s $2 : $2
next
}
$1 in f2 {
print $1, f2[$1]
next
}1' s=, OFS='\t' file2 file1
1,845
Posted By Scrutinizer
Another one: awk '!(NR%4-2){sub(/../,x)}1' file...
Another one:
awk '!(NR%4-2){sub(/../,x)}1' file

sed:
sed '2,${s/..//;n;n;n;}' file
1,845
Posted By itkamaraj
awk -v a=2 'NR==a{sub("^..","");a+=4}1'...
awk -v a=2 'NR==a{sub("^..","");a+=4}1' input.txt
1,845
Posted By pamu
awk '(NR-2)%4 == 0{$0=substr($0,3)}1' file
awk '(NR-2)%4 == 0{$0=substr($0,3)}1' file
4,178
Posted By danmero
Try this one: awk...
Try this one:
awk 'NR==FNR{a[$4]=$5_}a[$1]{print $0"\t"a[$1]}' Gene_Count.txt Pval.txt
4,178
Posted By lnviyyapu
Column comparision between two files
while read line2
do
a=`echo $line2 |awk '{print $1}'`
d=`echo $line2 |awk '{print $2}'`
while read line1
do
b=`echo $line1|awk '{print $1}'`
c=`echo $line1|awk '{print $2}'`
if [ $a -eq $b ]...
4,178
Posted By kurumi
#!/usr/bin/env ruby -w ...
#!/usr/bin/env ruby -w
gc=File.read("genecount").scan(/(ID=.[^ \t]*)[[:space:]]*(\d+)/).flatten!
h = Hash[*gc]
File.readlines("genepval").each do |line|
print "{line.chomp} #{h[line.split[0]]}\n"...
4,178
Posted By danmero
Next time do that from the beginning and the...
Next time do that from the beginning and the problem will be solved faster ;)
Personally I'll opt for:
awk 'NR==FNR{a[$4]=$5}a[$1]{print $0"\t"a[$1]}' Gene_Count.txt Gene_Pval.txt
4,178
Posted By bartus11
awk 'NR==FNR{a[$4]=$5;next}$1 in a{print $0"...
awk 'NR==FNR{a[$4]=$5;next}$1 in a{print $0" "a[$1]}' freq.txt Pval.txt
4,178
Posted By pravin27
Try this, awk 'NR==FNR{a[$4]=$5;next}...
Try this,


awk 'NR==FNR{a[$4]=$5;next} a[$1] { print $0,"\t",a[$1]}' Gene_Count.txt Gene_Pval.txt
4,178
Posted By ygemici
# ./justdoit ID Pvalue Frequency 91500 ...
# ./justdoit
ID Pvalue Frequency
91500 0.004 29
91700 0.007 60
91800 0.12 77
91900 0.05 66
92000 0.99 70

## justdoit ##
#!/bin/bash
rm -f newfileXX...
1,622
Posted By frans
this should work #!/bin/bash head -1 file ...
this should work

#!/bin/bash
head -1 file
while read L
do
N=${L%.*}; N=${N##*\"}
((N>=23)) && ((N<60)) && echo $L
done < file
1,622
Posted By kurumi
$ ruby -ane 'f=$F[1].gsub!("\042","").to_f; print...
$ ruby -ane 'f=$F[1].gsub!("\042","").to_f; print if f > 23 and f < 61;print if $.==1' file
1,622
Posted By Scrutinizer
awk -F '[".]' 'NR==1 || $4>=23 && $4<60' infile ...
awk -F '[".]' 'NR==1 || $4>=23 && $4<60' infile

---------- Post updated at 12:37 ---------- Previous update was at 12:18 ----------

{ read line; echo "$line"
while read line
do
...
1,622
Posted By durden_tyler
Perl one-liner - $ $ $ cat f23 ...
Perl one-liner -


$
$
$ cat f23
"ID" "DP"
"ID=GRMZM2G015073_T01" "23.6044288292005"
"ID=GRMZM2G119852_T01" "59.7782287606723"
"ID=GRMZM2G100242_T02" "61.4167813736184"...
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy