Skip to content

Instantly share code, notes, and snippets.

View soerlemans's full-sized avatar

Soerlemans soerlemans

View GitHub Profile
@soerlemans
soerlemans / csv2md.awk
Last active May 25, 2025 16:11
Awk script that converts a CSV file to a markdown table (evenly spaces columns based on longest column).
#!/usr/bin/env -S awk -f
# hidx = header index (zero indexed)
# ridx = row index (zero indexed)
# cidx = column index (zero indexed)
# fidx = field index (used in conjunction with $<expr>)
# Repeat a string n times.
function repeat(t_count, t_str) {
temp = ""