User Tools

Site Tools


cs_lang:awk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
cs_lang:awk [2012/04/30 09:28] cedriccs_lang:awk [2012/04/30 09:29] cedric
Line 48: Line 48:
 } }
 print ligne print ligne
 +}
 +</code>
 +
 +
 +===== Replace (tr) =====
 +<code awk>
 +BEGIN {c1="i"; c2="I"}
 +{
 +for(i=1 ; i <= length($0) ; i++) {
 + if (substr($0,i,1) == c1)
 + printf("%c",c2)
 + else
 + printf("%c",substr($0,i,1)) }
 +printf("\n")
 } }
 </code> </code>
cs_lang/awk.txt · Last modified: 2012/04/30 09:30 by cedric