Skip to content

Instantly share code, notes, and snippets.

@aji
Created May 27, 2012 22:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aji/2816237 to your computer and use it in GitHub Desktop.
Save aji/2816237 to your computer and use it in GitHub Desktop.
weelog -- easily convert chat logs formatted by weechat into a format more typical of IRC logs
#!/usr/bin/awk -f
BEGIN { FS="\t"; }
{
split($1, timesplit, / +/);
time = timesplit[2]
if (time == "")
time = "--:--:--";
prefix = $2;
if (prefix !~ /^[\-><*]*$/)
prefix = sprintf("<%s>", prefix);
printf("[%s] %s %s\n", time, prefix, $3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment