posix - scanf,back reference in awk -
is there implementation of scanf()(like in c) in awk(posix)?
i know awk not have reference in sed , perl. easiest way simulate in awk?
thanks
nyan
sprintf() , printf() may looking for. awk not support backreferences gawk's gensub(), or gsub() can provide backreferences.
backreferences storing strings matched. so, making use of awk's capability differentiate fields , field delimiters, using internal variables ofs,fs,ors etc way go.. eg
$ echo "test.txt" | sed 's/\(.*\).txt/\1.pdf/' test.pdf $ echo "test.txt" | awk -f"." '{$nf="pdf"}1' ofs="." test.pdf
of course, simple example. idea.
Comments
Post a Comment