cs_lang:awk
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
cs_lang:awk [2012/04/30 09:27] – created cedric | cs_lang:awk [2012/04/30 09:29] – cedric | ||
---|---|---|---|
Line 23: | Line 23: | ||
</ | </ | ||
+ | ===== Round time ===== | ||
+ | <code awk> | ||
+ | ligne="" | ||
+ | { for(i=1; i<=NF; i++) { | ||
+ | if ($i !~ / | ||
+ | ligne=ligne" | ||
+ | else | ||
+ | { | ||
+ | split($i, | ||
+ | T[3]=int((T[3]+5)/ | ||
+ | if (T[3]==60) | ||
+ | { | ||
+ | T[3]=" | ||
+ | T[2]++ | ||
+ | if (T[2]==60) | ||
+ | { | ||
+ | T[2]=" | ||
+ | T[1]++ | ||
+ | } | ||
+ | } | ||
+ | if (T[3] == 0) T[3] = " | ||
+ | ligne=ligne" | ||
+ | } | ||
+ | } | ||
+ | print ligne | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Replace (tr) ===== | ||
+ | <code awk> | ||
+ | BEGIN {c1=" | ||
+ | { | ||
+ | for(i=1 ; i <= length($0) ; i++) { | ||
+ | if (substr($0, | ||
+ | printf(" | ||
+ | else | ||
+ | printf(" | ||
+ | printf(" | ||
+ | } | ||
+ | </ |
cs_lang/awk.txt · Last modified: 2012/04/30 09:30 by cedric