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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -