#! /usr/bin/gawk -f # Last edited on 2014-12-03 00:10:42 by stolfilocal BEGIN \ { # Converts an HTML page fetched from "http://www.walletexplorer.com/" # to a ".txt" file. Splits each input data line into one or more lines, # one for each transaction input or output. # Note that the transactions are in inverse chronological order # and addresses are combined into "wallets" by some unspecified # clustering logic. abort = -1; # Needs the wallet name, for intra-wallet transactions: if (wallet == "") { arg_error(("must define {wallet}")); } # Make sure that conversions of numbers to strings and vice-versa preserve 8 decimals after point: OFMT = "%.8f"; CONVFMT = "%.8f"; nin = 0; # Number of data lines in input page. nout = 0; # Number of data lines in putput file. # Total received and sent in file: vbtc_tot_R = 0; vbtc_tot_S = 0; # Max absolute received and sent in file: vbtc_max_R = 0; vbtc_max_S = 0; # Number of receives, sends, and rearrangents: nout_R = 0; nout_S = 0; nout_I = 0; } (abort >= 0) { exit abort; } # Expand tabs, non-breaking spaces: // \ { gsub(/[ ]/, " ", $0); gsub(/[&]nbsp;/, " ", $0); } # Remove headers and other non-data stuff: /^ *$/ { next; } /^ * *$/ { next; } /^ * *$/ { next; } /^ * *$/ { next; } /^ *