Search Results

Search: Posts Made By: Apollo
1,935
Posted By Don Cragun
If you're willing to accept output with values in...
If you're willing to accept output with values in each column presented in the same order as they were seen in encountered in the input, you could try something like:
awk '
function...
1,405
Posted By RudiC
sort is working on lines, not on columns. So you...
sort is working on lines, not on columns. So you can't get what I infer from your post you want to get.

Use two files, sort them individually, and paste them together.
2,318
Posted By Scott
You were testing if $10 starts with two numbers,...
You were testing if $10 starts with two numbers, or if the whole line ($0) starts with two numbers and a decimal and another number.


$ echo a b c d e f g h i 1 | awk '$10 ~ /^1/ || $0 ~ /^2/'
a...
2,318
Posted By Scott
If there's two whole numbers before the decimal...
If there's two whole numbers before the decimal to qualify as "slow", does it matter if there's a decimal at all?


$ ping www.google.com | awk -F"[= ]" '{ print ($10 ~ /^[0-9][0-9]/)?"SLOW":$0 }'...
5,048
Posted By Don Cragun
You can add print or printf statements in...
You can add print or printf statements in appropriate places in your code.

If you want to build in debugging prints that don't normally print, but can be turned on when needed, you can make the...
1,224
Posted By Scrutinizer
awk code consists of a begin, end and middle...
awk code consists of a begin, end and middle section. The middle section is executed per record or line and so there is an implicit loop. Any section can be omitted. The section you posted is from...
3,408
Posted By Scrutinizer
print is short for print $0, which is the record,...
print is short for print $0, which is the record, the entire line in this case. gsub alters the string specified in the third field. In the first case, $0 does not get altered, in the second case it...
915
Posted By jim mcnamara
This is an online guide to understanding all the...
This is an online guide to understanding all the features of awk.

The GNU Awk User's Guide (http://www.gnu.org/software/gawk/manual/gawk.html)

This is sort of de facto guide to awk.

sed &...
Showing results 1 to 8 of 8

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