Search Results

Search: Posts Made By: Lucky Ali
2,829
Posted By RudiC
Not sure. As F[ ] elements are created when...
Not sure. As F[ ] elements are created when referenced, memory may become exhausted, but then the error msg should complain about memory allocation problems. Try this:awk 'NR == FNR ...
919
Posted By rdrtx1
try: awk 'a[$1]++ ? 0 : 1' infile
try:
awk 'a[$1]++ ? 0 : 1' infile
1,524
Posted By Corona688
Yes, it reads it. If you really wanted you...
Yes, it reads it.

If you really wanted you could embed it into awk itself like

T[1,"T"]=1;
T[1,"C"]=2;
... in the BELOW section instead, but when there's more than three lines of it, I tend...
2,558
Posted By agama
Have a go with this: awk ' { ...
Have a go with this:


awk '
{
n = split( $0, a, "" );
for( i = 1; i <= n; i++ )
{
count[a[i]]++;
pos[a[i]] = sprintf( "%s%d ", pos[a[i]],...
8,370
Posted By bartus11
Try: sort -nk5 file
Try: sort -nk5 file
3,467
Posted By itkamaraj
$nawk...
$nawk '{for(i=1;i<=NF;i++){if(i==1){printf("%s\t",$i);}else if(i==2){printf("%s ",$i);} else {printf(" %s",$i);} if(i==NF)printf("\n"); }}' inputfile
cgd1_10
cgd1_100
cgd1_1000 ...
1,992
Posted By yinyuemi
try: awk ' {if(/[a-z]/){x++} ...
try:

awk '
{if(/[a-z]/){x++}
{for(i=1;i<=NF;i++) a[x,NR,i]=$i;t=NR;s=NF
}}
END {for(l=1;l<=x;l++)
{for(m=1;m<=s;m++)
{for(n=1;n<=t;n++) {printf (length(a[l,n,m])>0?a[l,n,m]" ":"")}
{print...
1,992
Posted By Scrutinizer
Try this, which works as described earlier: awk...
Try this, which works as described earlier:
awk 'function pm(){
for(j=1;j<=NF;j++)
for(i=1;i<=m;i++)
printf "%s"(i<m?OFS:RS),M[j,i]
}
/[[:alpha:]]/{
...
3,809
Posted By durden_tyler
Inline editing of the file using Perl - ...
Inline editing of the file using Perl -


$
$
$ cat f0
1102
1
1
1
1
1234
1
1
1
1
1009
1
1
1
3,809
Posted By anurag.singh
sed 's/^1$//' inputFile OR awk...
sed 's/^1$//' inputFile

OR

awk '{if(0+$0 ==1) $0="";}1' inputFile
1,463
Posted By Scott
$ awk '!L[$1]++' file1 a dfg 3 6 8 9 b ghj 9...
$ awk '!L[$1]++' file1
a dfg 3 6 8 9
b ghj 9 0 4 2
c jkl 2 4 5 7
d kml 9 2 5 7
e lsd 3 6 8 9


You could also do it with sort:

sort -uk1,1 file1
1,808
Posted By bartus11
awk...
awk 'FNR==1{a=0}/>/{a++;if(a==6){split(FILENAME,n,"\\.");sub("^>","");print n[1]" "$0}}' * > output.txt
9,024
Posted By Franklin52
awk 'BEGIN{print 1;for(i=200;i<10001;i+=200)print...
awk 'BEGIN{print 1;for(i=200;i<10001;i+=200)print i}' |
while read a
do
echo $a
done
9,024
Posted By danmero
i=0 while [ $i -lt 100000 ] do let...
i=0
while [ $i -lt 100000 ]
do
let i+=200 # increase value
echo $i # do something here
done
2,071
Posted By Scrutinizer
For example if the values are two per line in the...
For example if the values are two per line in the input file, you could try something like this:
i=0
while read begin end
do
perl ex.pl -b "$begin" -e "$end" -c plot plot.txt $((++i))_plot.txt...
1,564
Posted By alister
for f in *.fasta; do printf...
for f in *.fasta; do
printf '/^>/;/^>/-d\nw\nq\n' | ed -s "$f"
done
1,482
Posted By Scrutinizer
Try: awk...
Try:
awk 'NR==FNR&&/^>/{A[$1]=$0;next}/^>/{if(A[$1]){$0=A[$1];p=1}else p=0}p' file2 file1
2,256
Posted By Scrutinizer
How about: awk...
How about:
awk 'NR==FNR{$1=">"$1;A[$1]=$0;next}A[$1]{$0=A[$1]}1' file2 file1
Showing results 1 to 18 of 18

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