If you don't really need the output in HTML, but you're having trouble with column alignment using tabs, you can get good column alignment with printf
.
By the way, it would help if your question included some sample input, the script that you're using to parse and output it and some sample output.
Here is a simple demonstration of printf
:
$ cat file
example text,123,word,23.12
more text,1004,long sequence of words,1.1
text,1,a,1000.42
$ cat script
#!/bin/bash
headformat='%-*s%-*s%*s%*s\n'
format='%-*s%-*s%*d%*.*f\n'
modwidth=16; descwidth=24; qtywidth=6; pricewidth=10
printf "$headformat" "$modwidth" Model "$descwidth" Desc. "$qtywidth" Qty "$pricewidth" Price
while IFS=, read model quantity description price
do
printf "$format" "$modwidth" "$model" "$descwidth" "$description" "$qtywidth" "$quantity" "$pricewidth" 2 "$price"
done < file
$ ./script
Model Desc. Qty Price
example text word 123 23.12
more text long sequence of words 1004 1.10
text a 1 1000.42