mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-22 07:30:43 +00:00
133 lines
No EOL
8.7 KiB
HTML
133 lines
No EOL
8.7 KiB
HTML
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Main reference — Miller 6.0.0-alpha documentation</title>
|
|
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
|
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
|
|
|
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
|
<script src="_static/jquery.js"></script>
|
|
<script src="_static/underscore.js"></script>
|
|
<script src="_static/doctools.js"></script>
|
|
<script src="_static/language_data.js"></script>
|
|
|
|
<link rel="index" title="Index" href="genindex.html" />
|
|
<link rel="search" title="Search" href="search.html" />
|
|
<link rel="next" title="Verbs reference" href="reference-verbs.html" />
|
|
<link rel="prev" title="Reference: online help" href="reference-main-online-help.html" />
|
|
</head><body>
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="reference-verbs.html" title="Verbs reference"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="reference-main-online-help.html" title="Reference: online help"
|
|
accesskey="P">previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="index.html">Miller 6.0.0-alpha documentation</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Main reference</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body" role="main">
|
|
|
|
<div class="section" id="main-reference">
|
|
<h1>Main reference<a class="headerlink" href="#main-reference" title="Permalink to this headline">¶</a></h1>
|
|
<p>TODO: keep splititng up this big file</p>
|
|
<div class="section" id="string-literals">
|
|
<h2>String literals<a class="headerlink" href="#string-literals" title="Permalink to this headline">¶</a></h2>
|
|
<p>You can use the following backslash escapes for strings such as between the double quotes in contexts such as <code class="docutils literal notranslate"><span class="pre">mlr</span> <span class="pre">filter</span> <span class="pre">'$name</span> <span class="pre">=~</span> <span class="pre">"..."'</span></code>, <code class="docutils literal notranslate"><span class="pre">mlr</span> <span class="pre">put</span> <span class="pre">'$name</span> <span class="pre">=</span> <span class="pre">$othername</span> <span class="pre">.</span> <span class="pre">"..."'</span></code>, <code class="docutils literal notranslate"><span class="pre">mlr</span> <span class="pre">put</span> <span class="pre">'$name</span> <span class="pre">=</span> <span class="pre">sub($name,</span> <span class="pre">"...",</span> <span class="pre">"...")</span></code>, etc.:</p>
|
|
<ul class="simple">
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\a</span></code>: ASCII code 0x07 (alarm/bell)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\b</span></code>: ASCII code 0x08 (backspace)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\f</span></code>: ASCII code 0x0c (formfeed)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\n</span></code>: ASCII code 0x0a (LF/linefeed/newline)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\r</span></code>: ASCII code 0x0d (CR/carriage return)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\t</span></code>: ASCII code 0x09 (tab)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\v</span></code>: ASCII code 0x0b (vertical tab)</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\\</span></code>: backslash</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\"</span></code>: double quote</p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\123</span></code>: Octal 123, etc. for <code class="docutils literal notranslate"><span class="pre">\000</span></code> up to <code class="docutils literal notranslate"><span class="pre">\377</span></code></p></li>
|
|
<li><p><code class="docutils literal notranslate"><span class="pre">\x7f</span></code>: Hexadecimal 7f, etc. for <code class="docutils literal notranslate"><span class="pre">\x00</span></code> up to <code class="docutils literal notranslate"><span class="pre">\xff</span></code></p></li>
|
|
</ul>
|
|
<p>See also <a class="reference external" href="https://en.wikipedia.org/wiki/Escape_sequences_in_C">https://en.wikipedia.org/wiki/Escape_sequences_in_C</a>.</p>
|
|
<p>These replacements apply only to strings you key in for the DSL expressions for <code class="docutils literal notranslate"><span class="pre">filter</span></code> and <code class="docutils literal notranslate"><span class="pre">put</span></code>: that is, if you type <code class="docutils literal notranslate"><span class="pre">\t</span></code> in a string literal for a <code class="docutils literal notranslate"><span class="pre">filter</span></code>/<code class="docutils literal notranslate"><span class="pre">put</span></code> expression, it will be turned into a tab character. If you want a backslash followed by a <code class="docutils literal notranslate"><span class="pre">t</span></code>, then please type <code class="docutils literal notranslate"><span class="pre">\\t</span></code>.</p>
|
|
<p>However, these replacements are not done automatically within your data stream. If you wish to make these replacements, you can do, for example, for a field named <code class="docutils literal notranslate"><span class="pre">field</span></code>, <code class="docutils literal notranslate"><span class="pre">mlr</span> <span class="pre">put</span> <span class="pre">'$field</span> <span class="pre">=</span> <span class="pre">gsub($field,</span> <span class="pre">"\\t",</span> <span class="pre">"\t")'</span></code>. If you need to make such a replacement for all fields in your data, you should probably simply use the system <code class="docutils literal notranslate"><span class="pre">sed</span></code> command.</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="clearer"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h3><a href="index.html">Table of Contents</a></h3>
|
|
<ul>
|
|
<li><a class="reference internal" href="#">Main reference</a><ul>
|
|
<li><a class="reference internal" href="#string-literals">String literals</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="reference-main-online-help.html"
|
|
title="previous chapter">Reference: online help</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="reference-verbs.html"
|
|
title="next chapter">Verbs reference</a></p>
|
|
<div role="note" aria-label="source link">
|
|
<h3>This Page</h3>
|
|
<ul class="this-page-menu">
|
|
<li><a href="_sources/reference.rst.txt"
|
|
rel="nofollow">Show Source</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="searchbox" style="display: none" role="search">
|
|
<h3 id="searchlabel">Quick search</h3>
|
|
<div class="searchformwrapper">
|
|
<form class="search" action="search.html" method="get">
|
|
<input type="text" name="q" aria-labelledby="searchlabel" />
|
|
<input type="submit" value="Go" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="reference-verbs.html" title="Verbs reference"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="reference-main-online-help.html" title="Reference: online help"
|
|
>previous</a> |</li>
|
|
<li class="nav-item nav-item-0"><a href="index.html">Miller 6.0.0-alpha documentation</a> »</li>
|
|
<li class="nav-item nav-item-this"><a href="">Main reference</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer" role="contentinfo">
|
|
© Copyright 2020, John Kerl.
|
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
|
</div>
|
|
</body>
|
|
</html> |