Search Results

Search: Posts Made By: Fahmida
1,280
Posted By RavinderSingh13
Hello Fahmida, Following may help you in...
Hello Fahmida,

Following may help you in same.

awk '{for(i=2;i<=NF;i++){print $1 OFS $i}}' OFS="\t" Input_file
Output will be as follows.

Data000005-RA GO:0003735
Data000005-RA ...
1,825
Posted By Scrutinizer
@RudiC, nice use of the "@" placeholder to...
@RudiC, nice use of the "@" placeholder to circumvent the lack of back reference in awk.....

It could be further reduced like this:
awk '
BEGIN{
A["CG"]="CG"
A["CXG"]="C[ACT]G"
...
1,825
Posted By RudiC
Seconding pilnet101's comments, I came up...
Seconding pilnet101's comments, I came up with:awk '{OA=OB=OC=$0
gsub(/CG/, "NULLG", OA); print OA > "File_CG_replace"
gsub(/C[^G]G/, "@&", OB); gsub (/@C/,"NULL", OB);...
1,101
Posted By neutronscott
sed 's/^\(>[^|]*\).*/\1/' file This is...
sed 's/^\(>[^|]*\).*/\1/' file

This is simple substitution command. Find lines starting with ">" up to "|" and replace the whole line with that part you want...
\( \) determines whats held in \1...
1,101
Posted By Akshay Hegde
Try $ awk -F"|" '/^>/{NF=1}1' file ...
Try

$ awk -F"|" '/^>/{NF=1}1' file

>Min_0-t10270-RA
MIGLGFKYLDTSYFGGFCEPSEDMNKVCTMRADCCEGIEMRFHDLKLVLEDWRNFTKLST
EEKRLWATPAAEDFF
>Min_0-t10271-RA...
1,101
Posted By Don Cragun
You could also try the slightly simpler awk and...
You could also try the slightly simpler awk and sed commands:
awk -F'|' '{print $1}' input
and
sed 's/|.*//' input
The awk command uses "|" as the field separator and prints the 1st field...
1,101
Posted By brianadams
#!/usr/bin/env perl open( $fh, "<",...
#!/usr/bin/env perl

open( $fh, "<", "yourfile") or die "Cannot open file: $!\n";
# go through the file line by line
while( my $line = <$fh>) {
chomp($line); #...
1,882
Posted By itkamaraj
$ nawk -F_ '{if(a==$3){print b;print...
$ nawk -F_ '{if(a==$3){print b;print $0}{a=$3;b=$0;next}}' inputfile
C_10_B05_SP6
C_10_B05_T7
C_10_B01_SP6
C_10_B01_T7
C_12_G11_SP6
C_12_G11_T7
C_2_I02_SP6
C_2_I02_T7



---------- Post...
12,972
Posted By ctsgnb
not sur about the grep -f <( ) syntax (may need...
not sur about the grep -f <( ) syntax (may need some syntax fix)
but maybe something like

for i in File*.txt; do grep -f <(cat File*.txt | sort | uniq -u | sed 's/.*/\^&\$/') $i | head -1...
2,047
Posted By binlib
awk ' NR == FNR && $5 != 0 { if ($4 > m1) {...
awk '
NR == FNR && $5 != 0 {
if ($4 > m1) {
m2 = m1
c2 = c1
m1 = $4
c1 = $1
} else if ($4 > m2) {
m2 = $4
c2 = $1
}
}
NR > FNR && ($1 == c1 || $1 == c2)
'...
2,636
Posted By radoulov
Use gawk, nawk or /usr/xpg4/bin/awk on Solaris: ...
Use gawk, nawk or /usr/xpg4/bin/awk on Solaris:

awk 'END {
if (rec && len <= t[2])
print rec
}
/^>/ {
if (len <= t[2]) print rec
rec = null; split($2, t, "="); t[2]
}
{ ...
Showing results 1 to 11 of 11

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