marqdo

Mid stdlib — csv and textok

features/11-csv-text.mq.md

文档

csv:lib/csv.mq.mdtext: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 =cityaccess(`r0`, "city")
> print text =nameaccess(`r0`, "name")
> print text=city
n = > len `rows`
  1. n == 2
    > print text=mid-m4-ok
  2. else
    > print text=mid-m4-fail
Functions
Variables
  • city text
    LONDON
  • description text
    lib/csv + thickened lib/text (Mid M4)
  • markup text
    occlusion
  • n int
    2
  • r0 map · 2
    nameAda
    citylondon
  • raw text
    name,city Ada,london Bob,PARIS
  • rows list · 2
    #namecity
    1Adalondon
    2BobPARIS
  • title text
    Mid stdlib — csv and text
可执行知识(辅助)

运行与结果

Ada LONDON mid-m4-ok
完整源码
---
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

Variable