#!/bin/sh
usage() { echo "Usage: $0 "'-d "your_input_data_delimiter_character" -t "My Title" -h "My Header"' 1>&2; exit 1; }
IFS_CHAR=" "
MY_TITLE="MY_TITLE"
MY_HEADER="MY_HEADER"
while getopts "d:t:h:" inp; do
case "${inp}" in
d)
IFS_CHAR=${OPTARG};;
t)
MY_TITLE=${OPTARG};;
h)
MY_HEADER=${OPTARG};;
*)
usage;;
esac
done
# Compose the html file with the Header, Body ( Data ) and Footer
echo ''
echo ''
echo '
'
# the following 10 lines are commented by way of the first and last line characters. Please remove the first and last lines to get fixed-width of columns. Also, adjust the number of col lines and their values, to suit yur input data.
<< --MULTILINE-COMMENT--
echo '
'
--MULTILINE-COMMENT--
# the following 13 lines are commented by way of the first and last line characters. Please remove the first and last lines to get customized table header lines. Also, adjust the number of header lines and header data, to suit your input.
<< --MULTILINE-COMMENT--
echo '
'
echo '
Title
'
echo '
Description
'
echo '
Version
'
# echo '
Author
'
echo '
Original-site
'
echo '
License
'
echo '
Size
'
echo '
Extension_by
'
echo '
Tags
'
echo '
'
--MULTILINE-COMMENT--
# Read the standard input data file contents into an Array, Check for URLs to Create Hyperlinks and
# Also Substitute html sensitive characters with proper syntax
cat - | sed '/^$/d' | awk -F "$IFS_CHAR" -v header=1 'BEGIN{OFS="\t";}
{
# gsub(/, "\\<")
# gsub(/>/, "\\>")
# gsub(/&/, "\\>")
print "\t