Yes, by playing on the RS I simplify the program.
BEGIN {RS="@" ; getline s1 < m2_file ; close(m2_file) ; RS="\n"}
(the variable m2_file is transmitted with option -v
Thank you !!
How to store into a awk variable the contents of a small file, which has several lines (obviously without affecting its content - the line breaks, the successive spaces, etc) ?
In fact I must make with awk the equivalent of
cat file | sed "s|TOTO|$toto|g;s|TITI|$titi|g;s|TATA|$tata|g"
the...
I concluded too quickly that only the first word is taken for the file passed with "|" + "-". In fact the problem is different. With file t1 and list_file yields:
t1:
one
two
three
list_file:
ident1
ident2
> cat t1 | awk '{print "NR="NR" FNR="FNR" "$0}' - list_file
NR=1 FNR=1 one
NR=2 FNR=1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.