文档中的步骤
结构步骤(非实际执行时序)
marqdo
Parse a tiny CSV, normalize a field, print — no plugins.
access(`r0`, "city")access(`r0`, "name")| name | Ada |
| city | london |
| key | value |
|---|---|
| name | Ada |
| city | london |
| # | name | city |
|---|---|---|
| 1 | Ada | london |
| 2 | Bob | PARIS |
| # | name | city |
|---|---|---|
| 1 | Ada | london |
| 2 | Bob | PARIS |
结构步骤(非实际执行时序)
--- markup: occlusion title: Mid stdlib — csv and text description: lib/csv + thickened lib/text (Mid M4) import: csv: lib/csv.mq.md text: lib/text.mq.md --- # CSV cleaning with text helpers Parse a tiny CSV, normalize a field, print — no plugins. # main **raw = "name,city\nAda,london\nBob,PARIS\n"** **rows = > csv.parse text=`raw`** **r0 = > at value=`rows` index=0** **city = > text.to_upper text=[city](access(`r0`, "city"))** > print text=[name](access(`r0`, "name")) > print text=`city` **n = > len `rows`** 1. `n` == 2 > print text=mid-m4-ok 2. * > print text=mid-m4-fail