Search Results

Search: Posts Made By: Kanja
906
Posted By Scrutinizer
Try: awk -v n=6 ' function fill() { ...
Try:

awk -v n=6 '
function fill() {
while (++i<=n)
print p,0
i=0
}
$1!=p && NR>1 {
fill()
}
{
++i
p=$1
print
}
END{
fill()
}
'...
2,900
Posted By durden_tyler
$ $ $ cat data.txt ...
$
$
$ cat data.txt
3386(11:11,Ani:0,Bri:1,ch:1,Jwe:0,Jor:0,LP:0,Lo:0,NS:1,al:1,bo:0,boy:0,bru:0,sh:0,cor:1,dum:0,ery:0,mac:0,mic:0)...
2,900
Posted By vgersh99
something along these lines: awk -f kanja.awk ...
something along these lines: awk -f kanja.awk myFile where kanja.awk is:

BEGIN {
FS="[():,]"
OFS="\t"
}
{
idL=(!idL)?$1:idL OFS $1
for(i=4;i<=NF-1;i=i+2) {
if (FNR==1)...
857
Posted By Don Cragun
If you don't mind having the same format in...
If you don't mind having the same format in output lines as you have in the input file, and none of fields 6 through 9 ever have negative values, the easy way to do what you requested would be:
awk...
1,251
Posted By RudiC
awk ' {LN[$1]; HD[$2]; MX[$1,$2]=1} ...
awk ' {LN[$1]; HD[$2]; MX[$1,$2]=1}
END { printf "%10s", ""; for (i in HD) printf "%10s", i; print "";
for (j in LN) {printf "%10s",j; for (i...
1,200
Posted By Yoda
Another awk approach: awk ' NR == FNR...
Another awk approach:
awk '
NR == FNR {
A[++c] = $1 OFS $2 OFS $3
next
}
{
for ( i = 1; i <= c; i++ )
{...
2,004
Posted By Akshay Hegde
I assumed that comma is separator use this ...
I assumed that comma is separator use this

%s/\<A1\>/test/g:%s/\<A1\>\C/test/g -----> case sensitive
1,096
Posted By RudiC
I guess this is what you want:awk '{max=""; for...
I guess this is what you want:awk '{max=""; for (i=4; i<=NF; i++) if ($i>max) max=$i; print $0, max/$3}' file
1 r 109 45 3 5 6 7 0.412844
2 f 300 249 5 8 10 0.83
3 g 120 4 5 110 0 0.916667
4 t...
Showing results 1 to 8 of 8

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