tsv_pretty

Command line tool that prints TSV data aligned for easier reading on consoles and traditional command-line environments.

Copyright (c) 2017-2018, eBay Software Foundation Initially written by Jon Degenhardt

Members

Enums

FieldAlignment
enum FieldAlignment
Undocumented in source.
FieldType
enum FieldType

FieldFormat holds all the formatting info needed to format data values in a specific column. e.g. Field 1 may be text, field 2 may be a float, etc. This is calculated during the caching phase. Each FieldFormat instance is part of a vector representing the full row, so each includes the start position on the line and similar data.

Functions

formatExponentValue
string formatExponentValue(char[] value, size_t precision)

formatExponentValue - Returns the printed representation of a raw value formatted using exponential notation and a specific precision. If the value cannot be interpreted as a double then the a copy of the original value is returned.

formatFloatingPointValue
string formatFloatingPointValue(char[] value, size_t precision)

formatFloatingPointValue - Returns the printed representation of a raw value formatted as a fixed precision floating number. This includes zero padding or truncation of trailing digits as necessary to meet the desired precision.

main
int main(string[] cmdArgs)
Undocumented in source. Be warned that the author may not have intended to support it.
monospacePrintWidth
size_t monospacePrintWidth(char[] str)

monospacePrintWidth - Calculates the expected print width of a string in monospace (fixed-width) fonts.

precisionDigits
size_t precisionDigits(char[] numericString)
Undocumented in source. Be warned that the author may not have intended to support it.
significantDigits
size_t significantDigits(char[] numericString)

significantDigits - Returns the number of significant digits in a numeric string.

tsvPretty
void tsvPretty(TsvPrettyOptions options, string[] files)

tsvPretty - Main loop, operating on input files and passing control to a TSVPrettyProccessor instance. This separates physical I/O sources and sinks from the underlying processing algorithm, which operates on generic ranges.

Structs

FieldFormat
struct FieldFormat
Undocumented in source.
TsvPrettyOptions
struct TsvPrettyOptions
Undocumented in source.
TsvPrettyProcessor
struct TsvPrettyProcessor

TsvPrettyProcessor - Maintains state of processing and exposes operations for processing individual input lines.

Variables

helpText
auto helpText;
Undocumented in source.
helpTextVerbose
auto helpTextVerbose;
Undocumented in source.

Meta