Skip to content

Instantly share code, notes, and snippets.

@btbytes
Last active June 5, 2020 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btbytes/3e53180ad90249ff41bd6ba9585f9b77 to your computer and use it in GitHub Desktop.
Save btbytes/3e53180ad90249ff41bd6ba9585f9b77 to your computer and use it in GitHub Desktop.
Nim as AWK
#? stdtmpl(emit="stdout.write &")
# import strformat, streams, parsecsv
# var x: CsvParser
# open(x, newFileStream(stdin), "-", '\t')
My Report
=========
{"":-<20} {"":-<20}
# while x.readRow():
{x.row[0]:<20} {x.row[1]:>20}
# end
{"":-<20} {"":-<20}
foo 1
bar 2
fuz 3
buz 4
#!/usr/bin/env bash
nim c -r my.nim < my.tsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment