RPV Reports / Usage Examples
 
Search in RpvSoftware.com
Go!                                         English    Español

What Rpv is

Rpv Reports 2024

Downloads

Training/Consultancy

Support

Purchase

Contact

 
Home > Usage Examples
Awk #2
This example shows how to prepare a report using AWK programming language & RPV Reports.

This easy Awk program generates an RPV file containing the current environment for Unix.

Please observe that newline (\n) has two backslashes. Remember that we're working in Unix.

How to run this
1- Place this program and name it with anyname.awk

2- Execute the following command at the prompt:
# set | awk -f anyname.awk > /tmp/rpvqueue/settings.rpv

Please note that the output of Awk is a file placed in /tmp/rpvqueue. That will be the queue directory and the server must be active and searching there.

Something better you can do
# set | awk -f anyname.awk > settings.rpv;mv settings.rpv /tmp/rpvqueue

In this case we're generating the file first and after that we're moving it to the queue directory. This would be the proper way.
Code
BEGIN {FS = "="

    print "report_title=unix environment (example with awk)"
    print "$1=400"
    print "$2=4000"
    print "[header]"
    print "{f=arial;s=10}"
    print "{spacing=600;\n}"
    print "{b=y;u=y;$1} Variable {$2} Value {b=n;u=n;\n;\n}"
    print "[data]"}
    {

        print "{$1} " $1 " {$2}= " $2 "{\n}"

    }

Home
What Rpv is
Rpv Reports 2024

Products
Rpv Reports 2024
Personalized edition

More...
Downloads
Support
Rpv Reports Online help
Rpv Visual Editor online help
Examples
/temp section
Videos




Copyright (c) 2001-2024 - Rpv Software. All rights reserved.