You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -115,6 +115,43 @@ If the item at the top of the data stack is not an object or if the object has n
115
115
.IP
116
116
If the \fIKEY\fR property of the object is an array subsequent commands will operate on one of the items in the array, chosen automatically by \fBjt\fR\. The array index will be available to subsequent commands via the index stack\.
Numbers may be expressed in a number of ways in JSON data, and there is a single \fBNumber\fR type that encompasses both integer and floating point\. Both decimal and exponential notation are valid in JSON\.
123
+
.
124
+
.SS "Strings"
125
+
\fBJt\fR does not unescape string values by default, in case they contain tab or newline characters that would break the tabular output format\. If unescaped values are needed this can be achieved by invoking \fBjt\fR with the \fB\-u\fR option in post processing\. For example:
126
+
.
127
+
.IP""4
128
+
.
129
+
.nf
130
+
131
+
$ jt \-u \'i love music \eu266A\'
132
+
i love music ♪
133
+
.
134
+
.fi
135
+
.
136
+
.IP""0
137
+
.
138
+
.SS "Numbers"
139
+
\fBJt\fR does not process numbers in any way \(em they are printed in the output verbatim, as they appear in the JSON input\. If special processing is required the \fBprintf\fR program in coreutils is your friend:
140
+
.
141
+
.IP""4
142
+
.
143
+
.nf
144
+
145
+
$ printf %\.0f 2\.99792458e9
146
+
2997924580
147
+
.
148
+
.fi
149
+
.
150
+
.IP""0
151
+
.
152
+
.SS "CSV Output"
153
+
The CSV format uses quoted values, which avoids the problems associated with values that contain tab and newline characters\. The \fB\-c\fR option puts \fBjt\fR into CSV output mode\. In this mode JSON strings are unescaped by default\. The \fBcsvtool\fR program and \fBcsvkit\fR suite of tools facilitate processing of CSV data in the shell\.
154
+
.
118
155
.SH "EXAMPLES"
119
156
We will use the following JSON input for the examples:
0 commit comments