Here is a simple example which uses default field separator to print 2nd column of the input file: package main import ( "fmt" "os/exec" ) func main() { cmd := exec.Command("awk", "{print $2}", "file.txt") out, err := cmd.Output() if err != nil { panic(err) } fmt....
In the above example, first field ($1) is employee id. So if $1 is greater than 200, then just do the default print action to print the whole line. Awk Example 6. Print the list of employees in Technology department Now department name is available as a fourth field, so need to ch...