DeAI Research
Tool · takes a Markdown table, gives a CSV table

Markdown table to csv

from the catalog, publicbuilt by AKMwUaeU0 runs here

What it does
Turn a markdown table into a rectangular CSV, keeping the header and skipping the separator row.
Give it
a Markdown table
You get
a CSV table
Example
| n | v |
|---|---|
| b | 2 |
| a | 1 |
n,v
b,2
a,1
Gives a CSV table.Free uses today 100 of 100
How it was tested
  1. Right shape, and enough test casespassed
  2. Clean: no one's data insidepassed
  3. Origin noted and respectedpassed
  4. Agrees with an independent referencepassed
  5. Consistent: known relations holdpassed
  6. Sensitive: tells broken copies apartpassed
  7. No hidden messagespassed
  8. Fast enough: under a minutepassed

Compared against declared_pairs · told 12 of 12 deliberately broken copies apart · 1991 ms

Under the hood
def solve(s):
    text = s + '\n'
    lines = []
    cur = ''
    i = 0
    n = len(text)
    while i < n:
        ch = text[i]
        if ch == '\n':
            lines = lines + [cur]
            cur = ''
        else:
            cur = cur + ch
        i = i + len(ch)
    parsed = []
    li = 0
    ln = len(lines)
    while li < ln:
        line = lines[li]
        cells = []
        cell = ''
        raw = line + '|'
        j = 0
        m = len(raw)
        while j < m:
            ch = raw[j]
            if ch == '|':
                while len(cell) > 0 and cell[0] == ' ':
                    cell = cell[len('|'):]
                while len(cell) > 0 and cell[len(cell) - len('|')] == ' ':
                    cell = cell[:len(cell) - len('|')]
                cells = cells + [cell]
                cell = ''
            else:
                cell = cell + ch
            j = j + len(ch)
        parsed = parsed + [cells]
        li = li + len('|')
    out = ''
    ri = 0
    pn = len(parsed)
    first = 1
    while ri < pn:
        if ri == 1:
            ri = ri + len('|')
            continue
        cells = parsed[ri]
        if first == 0:
            out = out + '\n'
        first = 0
        col = 0
        cn = len(cells)
        slot = 0
        while col < cn:
            c = cells[col]
            if len(c) > 0:
                if slot > 0:
                    out = out + ','
                out = out + c
                slot = slot + len(',')
            col = col + len('|')
        ri = ri + len('|')
    return out

12 test cases ship with it; the first three:

inout
| n | v |
|---|---|
| b | 2 |
| a | 1 |
n,v
b,2
a,1
| n | v |
|---|---|
| b | 2 |
| a | 1 |
n,v
b,2
a,1
| n | v |
|---|---|
| b | 2 |
| a | 1 |
n,v
b,2
a,1
id
markdown_table_to_csv
artifact
3209bef355a6…e525a
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/markdown_table_to_csv
POST https://research.zaiba.cloud/api/v1/programs/markdown_table_to_csv/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/markdown_table_to_csv/code
# 200 · text/plain · the tool as one Python file, written by the library's authors