From a7ec00a0379b5e7ffd5f2f541537fa1262ebf529 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 20 Mar 2020 21:50:13 -0400 Subject: [PATCH] Add documentation for from-ics and from-vcf (#1509) --- docs/commands/from-ics.md | 40 +++++++++++++++++++++++++++++++++++++++ docs/commands/from-vcf.md | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 docs/commands/from-ics.md create mode 100644 docs/commands/from-vcf.md diff --git a/docs/commands/from-ics.md b/docs/commands/from-ics.md new file mode 100644 index 0000000000..8fa970d6ef --- /dev/null +++ b/docs/commands/from-ics.md @@ -0,0 +1,40 @@ +# from-ics + +Parse text as `.ics` and create table. + +Syntax: `from-ics` + +## Examples + +Suppose calendar.txt is a text file that is formatted like a `.ics` (iCal) file: + +```shell +> open calendar.txt +BEGIN:VCALENDAR +BEGIN:VEVENT +DTSTART:20171007T200000Z +DTEND:20171007T233000Z +DTSTAMP:20200319T182138Z +SUMMARY:Basketball Game +UID:4l80f6dcovnriq38g57g07btid@google.com +... +``` + +Pass the output of the `open` command to `from-ics` to get a correctly formatted table: + +```shell +> open calendar.txt | from-ics +───┬────────────────┬──────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬──────────────── + # │ properties │ events │ alarms │ to-Dos │ journals │ free-busys │ timezones +───┼────────────────┼──────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼──────────────── + 0 │ [table 0 rows] │ [table 1 row] │ [table 0 rows] │ [table 0 rows] │ [table 0 rows] │ [table 0 rows] │ [table 0 rows] +───┴────────────────┴──────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴──────────────── +``` + +```shell +> open calendar.txt | from-ics | get events | get properties | where name == "SUMMARY" +─────┬─────────┬───────────────────────────────────────┬──────── + # │ name │ value │ params +─────┼─────────┼───────────────────────────────────────┼──────── + 0 │ SUMMARY │ Basketball Game │ +``` \ No newline at end of file diff --git a/docs/commands/from-vcf.md b/docs/commands/from-vcf.md new file mode 100644 index 0000000000..ce1901db25 --- /dev/null +++ b/docs/commands/from-vcf.md @@ -0,0 +1,37 @@ +# from-vcf + +Parse text as `.vcf` and create table. + +Syntax: `from-vcf` + +## Examples + +Suppose contacts.txt is a text file that is formatted like a `.vcf` (vCard) file: + +```shell +> open contacts.txt +BEGIN:VCARD +VERSION:3.0 +FN:John Doe +N:Doe;John;;; +EMAIL;TYPE=INTERNET:john.doe99@gmail.com +... +``` + +Pass the output of the `open` command to `from-vcf` to get a correctly formatted table: + +```shell +> open contacts.txt | from-vcf +─────┬───────────────── + # │ properties +─────┼───────────────── + 0 │ [table 8 rows] +``` + +```shell +> open contacts.txt | from-vcf | get properties | where $it.name == "FN" | pick value +─────┬────────────────────── + # │ value +─────┼────────────────────── + 0 │ John Doe +``` \ No newline at end of file