diag2cbor.rb < inputfile > outputfile