Search Results

Search: Posts Made By: jethrow
3,882
Posted By jethrow
awk ' $2=="CD" { key=$5"|"$9"|"; ...
awk '
$2=="CD" {
key=$5"|"$9"|";
($3>A[key"max"] || A[key"max"]=="")? A[key"max"]=$3:"";
($4>A[key"max"] || A[key"max"]=="")? A[key"max"]=$4:"";
($3<A[key"min"] || A[key"min"]=="")?...
2,480
Posted By jethrow
... on a side note, the ternary isn't...
... on a side note, the ternary isn't necessary:awk '/^@/{s=/192\.2\.3/}s' file
4,296
Posted By jethrow
awk 'NR>1 {print > (OFN=FILENAME"."(NR-1));...
awk 'NR>1 {print > (OFN=FILENAME"."(NR-1)); close(OFN)}' RS="--dump[^\n]*" file

EDIT:
... implemented this above ...
1,198
Posted By jethrow
perl -lape 'if($F[2] eq assumption) {$_.="$/$_";...
perl -lape 'if($F[2] eq assumption) {$_.="$/$_"; $_=~s/$F[2](.*?ID=\w+)\.\d/predictive\1/}' file
2,529
Posted By jethrow
script.ksh for num in `cat...
script.ksh
for num in `cat $*`;do((t+=num));done;echo $t
... or ...
awk '{for(i=1;i<=NF;i++)t+=$i} END {print t}' $*

echo 5 6 | sh script.ksh
2,529
Posted By jethrow
Not a fan of awk? for f in file1 file2 file3;...
Not a fan of awk?
for f in file1 file2 file3; do
while read line || [ -n "$line" ]; do
for num in $line; do
(( t += num ))
done
done < $f
done
echo $t
2,843
Posted By jethrow
Like this? awk -F"|" '{ if ($3=="Y" && $4==0...
Like this?
awk -F"|" '{
if ($3=="Y" && $4==0 && $6=="N")
variable1++
if ($3 =="Y" && $6=="N")
variable2++
}
END {print "variable1=" variable1 "\nvariable2=" variable2}' inputfil
10,105
Posted By jethrow
ip=`head -n1 file.dat` # read ip address from...
ip=`head -n1 file.dat` # read ip address from file
end=${ip##*\.} # delete everthing before last dot (leaving 234/235)

while (( end++ < 254 )); do # while the 234/235 is less than 254...
Showing results 1 to 8 of 8

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