Search Results

Search: Posts Made By: user8
2,788
Posted By user8
The usual approach is to put them either BEFORE...
The usual approach is to put them either BEFORE the BEGIN rule, or AFTER the END rule. Performance-wise, it doesn't matter. You might want to have a look at User-defined - The GNU Awk User's Guide...
3,620
Posted By user8
Another option which also seems to work: awk...
Another option which also seems to work:
awk '{str = str FS $4}!(NR%5){print "peak" ++c str; str=""}END{if (str) print "peak" ++c str}'
925
Posted By user8
awk '{ for (i = $2; i < $3; i += 100) { print $1,...
awk '{ for (i = $2; i < $3; i += 100) { print $1, (a[NR]++ ? i + 1 : i), i + 100 }'
1,412
Posted By user8
Assuming that you are interested in the last...
Assuming that you are interested in the last field of rows containing "Thermal thickness"
awk '/Thermal thickness/ { Tt = $NF }'
1,220
Posted By user8
You could start with: awk '{a[$3 " - "...
You could start with:
awk '{a[$3 " - " $6]++}END{ for (i in a) print i, "=", a[i]}'
1,412
Posted By user8
You can try: awk 'BEGIN{ print "sL0", "dL0",...
You can try:
awk 'BEGIN{ print "sL0", "dL0", "Tb","Tu"}/sL0.*dL0/{sL0=$3;dL0=$6}/Tb.*Tu/{ print sL0, dL0, $3,$6}'
6,240
Posted By user8
This works for me in bash: echo...
This works for me in bash: echo "'"${msg//\'/}"'"
2,014
Posted By user8
This works for me (using gawk): gawk -F',| '...
This works for me (using gawk):
gawk -F',| ' '!(a[$1,$2]++ + a[$2,$1]++)'
919
Posted By user8
I just tried this with GNU sort and awk and it...
I just tried this with GNU sort and awk and it seems to work fine:
sort -r -k5 t3 | awk '!a[$1,$3]++'PS: This record has no space between "Italy" and the pipe character.
Italy| John | 08:22:12:349
97,060
Posted By user8
About how to print: "last row with fifth column;...
About how to print: "last row with fifth column; in each file":
END{ print $5 }or in case you are using gawk 4.x:
ENDFILE{ print $5 }
7,433
Posted By user8
If I understood correctly, you could try this: ...
If I understood correctly, you could try this:

awk '$2>($6-1000000) || $2<($7+1000000)'

While thinking twice, I came to the conclusion that the above should better read

awk '$2>($6-1000000)...
Showing results 1 to 11 of 11

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