Skip to content

Commit

Permalink
Deployed cc836f7 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Dec 20, 2023
1 parent 8fa99c7 commit d88de13
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
26 changes: 26 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#mt940-to-csv" class="nav-link">mt940 to CSV</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#any-sql-to-xml" class="nav-link">Any SQL to XML</a>
<ul class="nav flex-column">
</ul>
Expand Down Expand Up @@ -311,6 +315,28 @@ <h3 id="csv-to-text">CSV to text</h3>
{{- end}}
</code></pre>
<p>note: CSV file must be <strong><a href="https://datatracker.ietf.org/doc/html/rfc4180">RFC4180</a></strong> compliant, file must have header line and separator must be <strong>comma ( , )</strong>. Or you can use command line argument -d ( e.g. <strong>-d ';'</strong> or <strong>-d 0x09</strong> ) to define separator(delimiter).</p>
<h3 id="mt940-to-csv">mt940 to CSV</h3>
<ul>
<li>mt940 returns simple struct (Header,Fields,[]Transactions) of strings and additional parsing needs to be done in template. This allows full flexibility on data processing</li>
<li>
<p>if parameter -d (delimiter -d "$") is defined for files with multiple messages (e.g. - Multicash), app returns array of mt940 messages</p>
</li>
<li>
<p>command</p>
</li>
</ul>
<pre><code class="language-sh">bafi.exe -i message.sta -t myTemplate.tmpl -o output.csv
</code></pre>
<ul>
<li>myTemplate.tmpl</li>
</ul>
<pre><code>Reference, balance, VS
{{- $F20 := .Fields.F_20 }}{{ $F60F := .Fields.F_60F }}
{{range .Transactions }}
{{- $vsS := add (indexOf .F_86 &quot;?21&quot;) 3 }} {{- $vsE := add $vsS 17 -}}
{{- $F20}}, {{$F60F}}, {{slice .F_86 $vsS $vsE}}
{{ end }}
</code></pre>
<h3 id="any-sql-to-xml">Any SQL to XML</h3>
<p>Bafi can be used in combination with very interesting tool <strong>USQL</strong> <a href="https://github.com/xo/usql">https://github.com/xo/usql</a>. USQL allows query almost any SQL like database (MSSQL,MySQL,postgres, ...) and get result in various formats. In this example we use -J for JSON. Output can be further processed by BaFi and templates</p>
<pre><code class="language-sh">usql.exe mssql://user:password@server/instance/database -c &quot;SELECT * FROM USERS&quot; -J -q | bafi.exe -f json -t &quot;?{{toXML .}}&quot;
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@
<div class="col-md-9" role="main">

<h1 id="bafi">BaFi</h1>
<p><strong>Universal JSON, BSON, YAML, CSV, XML translator to ANY format using templates</strong></p>
<p><strong>Universal JSON, BSON, YAML, CSV, XML, mt940 translator to ANY format using templates</strong></p>
<p><strong>Github repository</strong>
- <a href="https://github.com/mmalcek/bafi">https://github.com/mmalcek/bafi</a></p>
<p><strong>Releases (Windows, MAC, Linux)</strong>
- <a href="https://github.com/mmalcek/bafi/releases">https://github.com/mmalcek/bafi/releases</a></p>
<h2 id="key-features">Key features</h2>
<ul>
<li>Various input formats <strong>(json, bson, yaml, csv, xml)</strong></li>
<li>Various input formats <strong>(json, bson, yaml, csv, xml, mt940)</strong></li>
<li>Flexible output formatting using text templates</li>
<li>Support for <a href="https://www.lua.org/pil/contents.html">Lua</a> custom functions which allows very flexible data manipulation</li>
<li>stdin/stdout support which allows get data from source -&gt; translate -&gt; delivery to destination. This allows easily translate data between different web services like <strong>REST to SOAP, SOAP to REST, REST to CSV, ...</strong></li>
Expand Down Expand Up @@ -299,7 +299,7 @@ <h2 id="command-line-arguments">Command line arguments</h2>
</ul>
</li>
<li><strong>-f json</strong> Input format. <ul>
<li>Supported formats: <strong>json, bson, yaml, csv, xml</strong></li>
<li>Supported formats: <strong>json, bson, yaml, csv, xml, mt940</strong></li>
<li>If not defined (for file input) app tries detect input format automatically by file extension</li>
</ul>
</li>
Expand Down Expand Up @@ -558,5 +558,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2023-10-12 20:37:03.403813+00:00
Build Date UTC : 2023-12-20 14:00:36.963080+00:00
-->
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://mmalcek.github.io/bafi/</loc>
<lastmod>2023-10-12</lastmod>
<lastmod>2023-12-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://mmalcek.github.io/bafi/about/</loc>
<lastmod>2023-10-12</lastmod>
<lastmod>2023-12-20</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://mmalcek.github.io/bafi/examples/</loc>
<lastmod>2023-10-12</lastmod>
<lastmod>2023-12-20</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit d88de13

Please sign in to comment.