Browse Source

CSV parameters

pull/187/head
Jure Šorn 10 months ago
parent
commit
f5c2495d99
3 changed files with 17 additions and 17 deletions
  1. 12
      README.md
  2. 16
      index.html
  3. 6
      parse.js

12
README.md

@ -1835,12 +1835,12 @@ import csv
### Parameters
* **`'dialect'` - Master parameter that sets the default values. String or a 'csv.Dialect' object.**
* **`'delimiter'` - A one-character string used to separate fields.**
* **`'lineterminator'` - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.**
* **`'quotechar'` - Character for quoting fields that contain special characters.**
* **`'escapechar'` - Character for escaping quotechars.**
* **`'doublequote'` - Whether quotechars inside fields are/get doubled or escaped.**
* **`'skipinitialspace'` - Is space character at the start of the field stripped by the reader.**
* **`'lineterminator'` - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.**
* **`'quoting'` - 0: As necessary, 1: All, 2: All but numbers which are read as floats, 3: None.**
* **`'escapechar'` - Character for escaping quotechars if 'doublequote' is False.**
* **`'skipinitialspace'` - Is space character at the start of the field stripped by the reader.**
### Dialects
```text
@ -1848,12 +1848,12 @@ import csv
| | excel | excel-tab | unix |
+------------------+--------------+--------------+--------------+
| delimiter | ',' | '\t' | ',' |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quotechar | '"' | '"' | '"' |
| escapechar | None | None | None |
| doublequote | True | True | True |
| skipinitialspace | False | False | False |
| lineterminator | '\r\n' | '\r\n' | '\n' |
| quoting | 0 | 0 | 1 |
| escapechar | None | None | None |
| skipinitialspace | False | False | False |
+------------------+--------------+--------------+--------------+
```

16
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>April 13, 2024</aside>
<aside>April 14, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -1528,22 +1528,22 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
<div><h3 id="parameters">Parameters</h3><ul>
<li><strong><code class="python hljs"><span class="hljs-string">'dialect'</span></code> - Master parameter that sets the default values. String or a 'csv.Dialect' object.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'delimiter'</span></code> - A one-character string used to separate fields.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'lineterminator'</span></code> - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'quotechar'</span></code> - Character for quoting fields that contain special characters.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'escapechar'</span></code> - Character for escaping quotechars.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'doublequote'</span></code> - Whether quotechars inside fields are/get doubled or escaped.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'skipinitialspace'</span></code> - Is space character at the start of the field stripped by the reader.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'lineterminator'</span></code> - How writer terminates rows. Reader is hardcoded to '\n', '\r', '\r\n'.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'quoting'</span></code> - 0: As necessary, 1: All, 2: All but numbers which are read as floats, 3: None.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'escapechar'</span></code> - Character for escaping quotechars if 'doublequote' is False.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'skipinitialspace'</span></code> - Is space character at the start of the field stripped by the reader.</strong></li>
</ul><div><h3 id="dialects">Dialects</h3><pre><code class="text language-text">┏━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓
┃ │ excel │ excel-tab │ unix ┃
┠──────────────────┼──────────────┼──────────────┼──────────────┨
┃ delimiter │ ',' │ '\t' │ ',' ┃
┃ lineterminator │ '\r\n' │ '\r\n' │ '\n' ┃
┃ quotechar │ '"' │ '"' │ '"' ┃
┃ escapechar │ None │ None │ None ┃
┃ doublequote │ True │ True │ True ┃
┃ skipinitialspace │ False │ False │ False ┃
┃ lineterminator │ '\r\n' │ '\r\n' │ '\n' ┃
┃ quoting │ 0 │ 0 │ 1 ┃
escapechar │ None │ None │ None ┃
┃ skipinitialspace │ False │ False │ False ┃
┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛
</code></pre></div></div>
@ -2935,7 +2935,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the activ
<footer>
<aside>April 13, 2024</aside>
<aside>April 14, 2024</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

6
parse.js

@ -464,12 +464,12 @@ const DIAGRAM_9_B =
"┃ │ excel │ excel-tab │ unix ┃\n" +
"┠──────────────────┼──────────────┼──────────────┼──────────────┨\n" +
"┃ delimiter │ ',' │ '\\t' │ ',' ┃\n" +
"┃ lineterminator │ '\\r\\n' │ '\\r\\n' │ '\\n' ┃\n" +
"┃ quotechar │ '\"' │ '\"' │ '\"' ┃\n" +
"┃ escapechar │ None │ None │ None ┃\n" +
"┃ doublequote │ True │ True │ True ┃\n" +
"┃ skipinitialspace │ False │ False │ False ┃\n" +
"┃ lineterminator │ '\\r\\n' │ '\\r\\n' │ '\\n' ┃\n" +
"┃ quoting │ 0 │ 0 │ 1 ┃\n" +
"┃ escapechar │ None │ None │ None ┃\n" +
"┃ skipinitialspace │ False │ False │ False ┃\n" +
"┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛\n";
const DIAGRAM_95_A =

Loading…
Cancel
Save