#!/bin/bash
# Convert Excel file to CSV
ssconvert your_spreadsheet.xlsx your_spreadsheet.csv
# Convert CSV to HTML table
csv_to_html() {
echo "<table border='1'>"
while IFS=, read -r col1 col2 col3; do
echo "<tr><td>$col1</td><td>$col2</td><td>$col3</td></tr>"
done < your_spreadsheet.csv
echo "</table>"
}
# Store HTML content in a variable
html_content=$(csv_to_html)
# Send email
sendmail [email protected] <<EOF
Subject: Spreadsheet Contents
Content-Type: text/html
<html>
<body>
$html_content
</body>
</html>
EOF