Hi All,
Sorry for long topic here.
So the drill goes like that, I need a script which gathers different values from different files/locations.
A_CT=`cat a.dat | awk -F'|' '{print $1}' >> report.txt`
B_CT=`cat b.dat | awk -F'|' '{print $3}' >> report.txt`
C_CT=`cat c.dat | awk -F'|' '{print $5}' >> report.txt`
( this is how im planning to do for taking information i need, there will be 39 files like this, and the columns i print may vary, so im guessing im gonna have to make it this all the way down )
Then lets say i have body.html file where lays only the body of the table, where i have put collumn names and formated the table how i want. I dont have the code, but it's simple. So what i need is to take those values $A_CT, $B_CT , $C_CT and substitute everyhting i need in html body. As this substitution goes, it doesnt have to impact the original body.html
file but put a copy of lets say email_out_2015.08.31.html
for sending email.
Plus i will have some recipients to send this mail, what's your suggestion do i put recipients straight into script, like:
recipients=one@one.com two@two.com
... etc..
or should i have seperate file name recipients.txt
?
--------------------------------------------------------
The problems I've met already.
If i put the needed values into values.dat
file, and try putting them with this line :
awk 'BEGIN {print "<table>"}
{print "<tr>"; for(i = 1; i <= NF; i++) print "<td>" $i "</td>"; print "</tr>"}
END {print "</table>"}' report.txt > report.html
I dont get what i need, i dont get collumn names depending of the filename value has been taken off or, simple html configuration.
So guys any suggestions to do it in simple yet better way, than I'm doing this, cause I know this is an easy one, but since im the starter with UNIX I need your help guys. Any suggestions?
Thanks in advance ;}