Search Results

Search: Posts Made By: delugeag
1,354
Posted By delugeag
awk '{ for (i=2;i<=NF;i++) { n[i,$i]++ ...
awk '{
for (i=2;i<=NF;i++) {
n[i,$i]++
}
}

END {
for (i=2;i<=NF;i++) {
print n[i,1] " " n[i,2]
}
}' file
2,108
Posted By delugeag
I think you can do it with awk ? the 1) ...
I think you can do it with awk ?
the 1)

awk '
/^.........patern/ {n+=1}
/^.....patern/ {m+=1}
end {print n ; print m}
' file 6 "." is for the patern in the 7th column.
2,146
Posted By delugeag
cat $ORATAB | grep ^+ASM | wc -l please...
cat $ORATAB | grep ^+ASM | wc -l

please replace that by:
grep -c '^+ASM' $ORATAB
2,171
Posted By delugeag
$# return the number of argument.
$# return the number of argument.
2,708
Posted By delugeag
You forgot to add the numbers of the even lines....
You forgot to add the numbers of the even lines. The code sould be :
sum[i]/2 ==> (sum[i] + $i)/2
1,087
Posted By delugeag
grep -w '"nathan available"'
grep -w '"nathan available"'
6,611
Posted By delugeag
for example : awk ' BEGIN {sum=0;summ=0} ...
for example :

awk '
BEGIN {sum=0;summ=0}
{
arr[NR]=$1
sum+=$1
}
END {
average=sum/NR

for (i=1;i<=NR;i++) {
summ+=(arr[i]-average)^2
}
print summ
}
' fileplease...
1,661
Posted By delugeag
Easy (but you have to add a condition if you want...
Easy (but you have to add a condition if you want to manage lines with only one field):
awk '{for (i=2;i<=NF;i++) {print $1 OFS $i}}' A.txt > B.txt
1,395
Posted By delugeag
If files are sorted and they don't have headers...
If files are sorted and they don't have headers and the second field of file1 is never empty:
join -a 2 -e 'Not found in File1' -o 2.1,1.2 file1 file2
8734060356 2
8734079909 Not found in File1...
2,742
Posted By delugeag
sed -n -r '/Name =A/,/Value =/{/Value = (.*)/...
sed -n -r '/Name =A/,/Value =/{/Value = (.*)/ s//\1/p}' $file
3,264
Posted By delugeag
find can do the same thing with printf ...
find can do the same thing with printf

-printf "%T@ %f\n"
6,212
Posted By delugeag
no it's not the same, there is a bold { in the...
no it's not the same, there is a bold { in the line with the new test.
You have to know this :

#!/bin/awk -f
/test/
{
code
}
it's not the same than :


#!/bin/awk -f
/test/ {
code
}...
6,212
Posted By delugeag
Try this #!/bin/awk -f BEGIN { ...
Try this

#!/bin/awk -f

BEGIN {

AlarmNbeg = "alarmNew";
AlarmClbeg = "alarmCleared";
AlarmChbeg = "alarmChanged";
AckStatbeg = "ackStateChanged";
TotBlocks = 0;
}
...
5,599
Posted By delugeag
you must put the awk code between quotes ! ...
you must put the awk code between quotes !

awk -F ' ' '{printf "%s\t%s\t%s\t%s\t%s\t%s",$15,$2,$0,$16,$4,$5;}' <test.txt> test.bim
1,726
Posted By delugeag
join is for joining file if you want to find uniq...
join is for joining file if you want to find uniq line you can use… wait a minute… uniq !

sort file1 file2 | uniq -uthis code doesn't work if :
file1:
a
a
b
c
file2:
b
c
d
d
e
output:...
4,162
Posted By delugeag
awk '{printf $1 " " $2 " " $3 " " $4 " " $5 " "...
awk '{printf $1 " " $2 " " $3 " " $4 " " $5 " " $6;for (i=7;i<=NF;i+=2) {printf " " $i $(i+1)};printf "\n"}'

the first printf may be optimized.
65,309
Posted By delugeag
All commands are 1 input and 2 outputs : - the...
All commands are 1 input and 2 outputs :
- the standart output (stdout)
- the standart error output (stderr)

In the console input is the keyboard and outputs are the screen.

So this line :...
2,842
Posted By delugeag
There is a mistake on the 2nd question. I guess...
There is a mistake on the 2nd question. I guess you find this code on internet but did you test it ?
It counts the number of files in the directories and subdirectories instead of the number of...
1,089
Posted By delugeag
awk '{if ($0 ~ /abc/) print $2 ; else print}'
awk '{if ($0 ~ /abc/) print $2 ; else print}'
986
Posted By delugeag
Or with awk : awk -F ':' '{for (i=1;i<=NF;i++)...
Or with awk :
awk -F ':' '{for (i=1;i<=NF;i++) if ($i == "Clone") print $(i-2)}'
2,454
Posted By delugeag
end_hostname=$(hostname -s|tr -cd 0-9|sed -e...
end_hostname=$(hostname -s|tr -cd 0-9|sed -e 's/^0//')
if [ -z "$end_hostname" ]
then
sleeptimer=$RANDOM
while [ $sleeptimer -gt 3600 ]; do
sleeptimer=$RANDOM
...
Showing results 1 to 21 of 21

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