Help to write a script or program to automatic execute and link input file data

Output file template format

<input_file_name>a</input_file_name>
<total_length_size>b</total_length_size>
<log_10_length_size>c</log_10_length_size>

Input_file_1 (eg. sample.txt)

SDFSDGDGSFGRTREREYWW

Parameter:
a is equal to the input file name
b is equal to the total length of input file
c is equal to the log10 of total length of input file

Desired output file

<input_file_name>sample.txt</input_file_name>
<total_length_size>20</total_length_size>
<log_10_length_size>1.301029996</log_10_length_size>

I got a standard output file template format and plan to generate an output file based on the data detail from input file.
Because I got long list of different input file which shared the share output file template format.
Thus I plan to write a program or shell script to calculate and execute the data detail from input file and link the result to the output file template.

something like:

#  awk 'END{print "<input_file_name>"FILENAME"</input_file_name>\n<total_length_size>"NR"</total_length_size>\n<log_10_length_size>"log(NR)/log(10)"</log_10_length_size>\n"}' syslog
<input_file_name>syslog</input_file_name>
<total_length_size>386</total_length_size>
<log_10_length_size>2.58659</log_10_length_size>

what you're after ?

Thanks for your suggestion, Tytalus.
At least got give me some hits to write the program.
Actually I just not sure how to calculate statistic of input file 1 data and then automatic link the "answer" to the output file template format :frowning: