Changes

Jump to navigation Jump to search
227 bytes added ,  17:11, 7 January 2018
Line 19: Line 19:  
== Print with condition ==
 
== Print with condition ==
 
  awk '{if ($3 =="" || $4 == "" || $5 == "") print "Some score for the student",$1,"is missing";'}' student-marks
 
  awk '{if ($3 =="" || $4 == "" || $5 == "") print "Some score for the student",$1,"is missing";'}' student-marks
 +
 +
== Print if value ==
 +
<nowiki>$ echo "a b c d" | awk '($4){print "yes"}'
 +
yes
 +
$ echo "a b c d" | awk '($14){print "yes"}' ## prints nothing, no $14
 +
$ echo "a b c 0" | awk '($4){print "yes"}' ## prints nothing, $4 is 0</nowiki>
    
== Print columns as lines ==
 
== Print columns as lines ==

Navigation menu