课程: AWK Essential Training

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Formatting output with printf()

Formatting output with printf() - Linux教程

课程: AWK Essential Training

Formatting output with printf()

- [Instructor] In addition to the print statement, AWK provides the function print F for formatted printing. In this lesson, we'll use print F to output a file of names, email addresses, and bowling averages in a nice columnar format for a fixed width font. You might do this to output the information interactively for easy reading in the terminal window. The print F function in AWK has much the same syntax as it does in the C programming language. Print F takes one argument, which is a format and then a number of arguments after that of values depending on the original format. The parentheses after print F are optional in AWK, but in most circumstances it's a good practice to include them. This function outputs zero or more values in the format specified by its format argument, which is a single string containing format specifiers that tell print F how to output the value arguments. Each format specifier is matched to a value in…

内容