Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: yoda9691
885
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..
885
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 ...
3,629
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

 

Featured Tech Videos

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