Bag-cat » History » Version 8
Version 7 (J. Moringen, 11/24/2011 03:04 PM) → Version 8/10 (J. Moringen, 12/13/2011 06:41 PM)
h1. @bag-cat@
{{>toc}}
h2. Introduction
Like UNIX @cat@, the @bag-cat@ program makes a stream of data available on its standard output stream. Unlike UNIX @cat@, the data is obtained by processing log files.
See [[Bag-record|bag-record]] for recording and [[Bag-play|bag-play]] for replaying events from log files.
h2. Obtaining @bag-cat@
Binaries of the @bag-cat@ program can be downloaded from the "continuous integration server":http://ci.cor-lab.org for versions 0.4, 0.5 and the current trunk version of the project:rsb:
* @bag-cat@ _is not available in the 0.4 version_
* "0.5 Linux i686":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=ubuntu_lucid_32bit/
* "0.5 Linux x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=ubuntu_lucid_64bit/
* "0.5 MacOS x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=MAC_OS_lion_64bit/
* "0.6 Linux i686":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=ubuntu_lucid_32bit/
* "0.6 Linux x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=ubuntu_lucid_64bit/
* "0.6 MacOS x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=MAC_OS_lion_64bit/
After the download, the @bag-cat@ file has to be made executable in most cases. This can be done for example by executing
<pre>
chmod +x bag-cat
</pre>
in the download directory.
h2. Checking Versions and Displaying Help
Version and help information is displayed when the @--version@ and @--help[-for all]@ commandline options are specified:
<pre>
./bag-cat --version
./bag-cat --help
./bag-cat --help-for all
</pre>
The output of @--help[-for all]@ includes a list of supported file formats.
h2. Printing the Contents of Log Files
When invoked with a log file, @bag-cat@ prints the contents of one or more channels to its standard output stream. This is probably most useful for channels containing textual data, since binary content usually requires a form of decoding.
Example:
<pre>
bag-cat ./bag-cat isr.tide | head
<sr db_start="80" db_utt="80" />
<sr db_start="45" db_utt="46" />
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<speech_hyp xmlns:bxml="http://www.sleepycat.com/2002/dbxml" [...]
<TIMESTAMP>1290275288296</TIMESTAMP>
</pre>
h3. Selecting Channels for Playback
The default behavior of @bag-cat@ is to print the contents of all channels found in the given file. However, when only a subset of the recorded channels should be printed, the @--channel@ (@-c@) commandline option can be used to select channels. The following example prints the contents all channels matching one of the regular expressions "hyp" and "param".
<pre>
bag-cat ./bag-cat -c 'hyp' -c 'param' /tmp/nao.tide
</pre>
h3. Controlling the Output Format
Like the [[rsb:Tools|logger], @bag-cat@ supports different output formats. These are controlled using the @--style@ option.
Example:
<pre>
$ bag-cat --style 'programmable :template "${create} ${data}\\n"' mydata.tide
2011-12-13T17:03:25.533535+01:00 #(98 108 117 98)
2011-12-13T17:03:25.534054+01:00 #(98 108 117 98)
2011-12-13T17:03:25.534121+01:00 #(98 108 117 98)
[...]
</pre>
h3. Caveats
* Individual entries can no longer be distinguished (unless some in-band properties permit this)
* If multiple channels are printed, the channel from which a given part of the output originated is no longer apparent (unless some in-band properties allow determining this)
* Printing channels which contain binary to a terminal content may mess up the terminal and cause all sorts of mayhem
{{>toc}}
h2. Introduction
Like UNIX @cat@, the @bag-cat@ program makes a stream of data available on its standard output stream. Unlike UNIX @cat@, the data is obtained by processing log files.
See [[Bag-record|bag-record]] for recording and [[Bag-play|bag-play]] for replaying events from log files.
h2. Obtaining @bag-cat@
Binaries of the @bag-cat@ program can be downloaded from the "continuous integration server":http://ci.cor-lab.org for versions 0.4, 0.5 and the current trunk version of the project:rsb:
* @bag-cat@ _is not available in the 0.4 version_
* "0.5 Linux i686":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=ubuntu_lucid_32bit/
* "0.5 Linux x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=ubuntu_lucid_64bit/
* "0.5 MacOS x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-0.5/label=MAC_OS_lion_64bit/
* "0.6 Linux i686":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=ubuntu_lucid_32bit/
* "0.6 Linux x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=ubuntu_lucid_64bit/
* "0.6 MacOS x86_64":https://ci.cor-lab.de/job/rsbag-tools-cl-trunk/label=MAC_OS_lion_64bit/
After the download, the @bag-cat@ file has to be made executable in most cases. This can be done for example by executing
<pre>
chmod +x bag-cat
</pre>
in the download directory.
h2. Checking Versions and Displaying Help
Version and help information is displayed when the @--version@ and @--help[-for all]@ commandline options are specified:
<pre>
./bag-cat --version
./bag-cat --help
./bag-cat --help-for all
</pre>
The output of @--help[-for all]@ includes a list of supported file formats.
h2. Printing the Contents of Log Files
When invoked with a log file, @bag-cat@ prints the contents of one or more channels to its standard output stream. This is probably most useful for channels containing textual data, since binary content usually requires a form of decoding.
Example:
<pre>
bag-cat ./bag-cat isr.tide | head
<sr db_start="80" db_utt="80" />
<sr db_start="45" db_utt="46" />
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><speech_hyp [...]
<speech_hyp xmlns:bxml="http://www.sleepycat.com/2002/dbxml" [...]
<TIMESTAMP>1290275288296</TIMESTAMP>
</pre>
h3. Selecting Channels for Playback
The default behavior of @bag-cat@ is to print the contents of all channels found in the given file. However, when only a subset of the recorded channels should be printed, the @--channel@ (@-c@) commandline option can be used to select channels. The following example prints the contents all channels matching one of the regular expressions "hyp" and "param".
<pre>
bag-cat ./bag-cat -c 'hyp' -c 'param' /tmp/nao.tide
</pre>
h3. Controlling the Output Format
Like the [[rsb:Tools|logger], @bag-cat@ supports different output formats. These are controlled using the @--style@ option.
Example:
<pre>
$ bag-cat --style 'programmable :template "${create} ${data}\\n"' mydata.tide
2011-12-13T17:03:25.533535+01:00 #(98 108 117 98)
2011-12-13T17:03:25.534054+01:00 #(98 108 117 98)
2011-12-13T17:03:25.534121+01:00 #(98 108 117 98)
[...]
</pre>
h3. Caveats
* Individual entries can no longer be distinguished (unless some in-band properties permit this)
* If multiple channels are printed, the channel from which a given part of the output originated is no longer apparent (unless some in-band properties allow determining this)
* Printing channels which contain binary to a terminal content may mess up the terminal and cause all sorts of mayhem