DSV Pipe (|) potential delimiter [ci skip]

This commit is contained in:
David Rault 2021-09-30 10:46:35 +02:00
parent e59de73f99
commit 0a0244cdfa
2 changed files with 10 additions and 6 deletions

@ -814,14 +814,16 @@ var PRN = (function() {
var guess_seps = {
/*::[*/0x2C/*::]*/: ',',
/*::[*/0x09/*::]*/: "\t",
/*::[*/0x3B/*::]*/: ';'
/*::[*/0x3B/*::]*/: ';',
/*::[*/0x7C/*::]*/: '|'
};
// CSV separator weights to be used in case of equal numbers
var guess_sep_weights = {
/*::[*/0x2C/*::]*/: 3,
/*::[*/0x09/*::]*/: 2,
/*::[*/0x3B/*::]*/: 1
/*::[*/0x3B/*::]*/: 1,
/*::[*/0x7C/*::]*/: 0
};
function guess_sep(str) {

@ -107,14 +107,16 @@ Plain text format guessing follows the priority order:
|:-------|:--------------------------------------------------------------------|
| XML | `<?xml` appears in the first 1024 characters |
| HTML | starts with `<` and HTML tags appear in the first 1024 characters * |
| XML | starts with `<` |
| XML | starts with `<` and the first tag is valid |
| RTF | starts with `{\rt` |
| DSV | starts with `/sep=.$/`, separator is the specified character |
| DSV | more unquoted `";"` chars than `"\t"` or `","` in the first 1024 |
| TSV | more unquoted `"\t"` chars than `","` chars in the first 1024 |
| DSV | more unquoted `|` chars than `;` `\t` `,` in the first 1024 |
| DSV | more unquoted `;` chars than `\t` or `,` in the first 1024 |
| TSV | more unquoted `\t` chars than `,` chars in the first 1024 |
| CSV | one of the first 1024 characters is a comma `","` |
| ETH | starts with `socialcalc:version:` |
| PRN | (default) |
| PRN | `PRN` option is set to true |
| CSV | (fallback) |
- HTML tags include: `html`, `table`, `head`, `meta`, `script`, `style`, `div`