3 # -------------------------------------------------------------------------
5 # Created by Fonic <https://github.com/fonic> -
8 # -------------------------------------------------------------------------
12 title_template="Ferengi Rule of Acquisition %s:"
14 source_template="-- %s"
21 echo "Usage: ${0##*/} INFILE OUTFILE"
29 # Convert CSV to DAT + wrap long lines + remove trailing whitespace
30 while IFS="${csv_delimiter}" read -r number rule source
32 printf -- "${title_template}\n" "${number}"
33 printf -- "${rule_template}\n" "${rule}"
34 printf -- "${source_template}\n" "${source}"
35 printf -- "${footer_template}\n"
36 done < "${infile}" | fold -sw "${line_maxlen}" | sed -e 's/[[:space:]]*$//' > "${outfile}"