RE: https://mastodon.social/@dchest/116334642837128276

As a follow up to this: there's also a Markdown mode:

sqlite> .mode markdown
sqlite> select * from mytable;

This will print out a Markdown table ready to paste into your text files, blog posts or *cough*llm*cough*.

Since SQLite supports importing CSV, here's a one-liner to convert a CSV file from stdin into a Markdown table:

sqlite3 :memory: -cmd ".mode csv" -cmd ".import /dev/stdin t" -cmd ".mode markdown" "SELECT * FROM t;"

#csv #markdown #sqlite

If you want HTML, just replace .mode markdown with .mode html