Command-line Options

Common Options
XML Options
CSV Options

Invoking asn2txt without any options will show a usage message that contains the command-line options:

ASN2TXT, version 2.3.x
ASN.1 to text formatter
Copyright (c) 2012 Objective Systems, Inc.  All Rights Reserved.

Usage: asn2txt <input files> options

  <input files>          ASN.1 message file name (wildcards are okay)

  options:
    -xml                   Output to XML
    -csv                   Output to CSV

  Common options:
    -schema <filename>     ASN.1 definition file name(s)
    -I <directory>         Import ASN.1 files from <directory>
    -ber                   Use basic encoding rules (BER)
    -pdu <typename>        Message PDU type name
    -bcdhandling <default|none|bcd|tbcd>
                           Define handling of OCTET STRINGs declared to be
                             binary coded decimal (BCD) strings
    -noopentype            Disable automatic open type decoding
    -paddingbyte <hexbyte> Additional padding byte
    -bitsfmt <hex|bin>     BIT STRING content output format
    -inputFileType <binary|hextext|base64>
                           Format of data in input file
    -skip <num>            Skip <num> bytes between messages
    -headerOffset <num>    Skip the first <num> bytes in a data file
    -lickey <key>          License key to activate

  XML options:
    -per                   Use aligned packed encoding rules (PER)
    -uper                  Use unaligned packed encoding rules (U-PER)
    -xer                   Output XML in ASN.1 XER format
    -o <filename>          Output XML filename (use "<base>.xml" for batch output)
    -ascii                 Print out ASCII for printable hex values
    -emptyoptionals        Insert empty XML elements in place of 
                             missing optional elements
    -emptydefault          Insert XML elements with default values in place
                             of missing elements with default values
    -nowhitespace          Remove all whitespace between elements
    -rootElement <element> Root Element Name

  CSV options:
    -s <separator>         Field separator
    -minLevel <num>        Set the minimum output depth
    -maxLevel <num>        Set the maximum output depth
    -q                     Turn off all output except errors
    -noquotes              Do not quote strings in output file
    -padFields             Pad fields with data that would otherwise be empty
    -prefix                Prefix output filenames with input filenames
      

The following sections summarize the command-line options.