Search Results

Search: Posts Made By: yoda9691
1,146
Posted By neutronscott
Just awk. awk ' ...
Just awk.


awk '
/measure1/{a["measure1"]=$NF}
/zdfg/{a["zdfg"]=$NF}
/cpu_use/{a["cpu_use"]=$NF}
END { printf("%s,%s,%s\n", a["measure1"],a["zdfg"],a["cpu_use"]) }' file


for a start..
1,146
Posted By Corona688
You can put more than one statement in one awk. ...
You can put more than one statement in one awk. In fact, you can do the entire thing in awk.

$ cat zaf.awk

BEGIN { OFS="," }

/measure1/ { MEASURE1=$NF }
/zdfg/ { ZDFG=$NF ...
4,393
Posted By Scrutinizer
You could scan for ------ and then print the next...
You could scan for ------ and then print the next line:
awk '/-{6}/{getline;$1=$1;print}' OFS=, ORS= infile
to print a linefeed after the output:
awk '/-{6}/{getline;$1=$1;print} END{print RS}'...
Showing results 1 to 3 of 3

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