Skip to content

Multiple sheets in asc, csv, ssv, tsv formats #102

@edemaine

Description

@edemaine

Currently, only spreadsheet formats like .xls/.xlsx support multiple sheets in a single file. It'd be nice to support this in other formats like ASCII art (.asc) and delimiter separated (.csv, .ssv, .tsv). Example applications:

  • GUI probably wants to work in a simple format like tsv, or at least have that option
  • If we define a way for mappings to work with an entire Drawings, e.g. for multiple overlaid drawings (Multiple overlaid drawings #97).
  • Convenient way to cluster drawings together, e.g. subfigures of a figure or a sequence of frames.

The challenge of course is defining a sheet delimiter format. One idea that comes to mind is to use an ASCII control code, followed by a sheet name. Some options that seem to fit:

  • 1 ^A SOH Start of Header indicates "head of data broadcast/message"
  • 2 ^B STX Start of Text indicates "end of header, start of text" (so could be ^A<sheet name>^B)
  • 3 ^C ETX End of Text indicates "end of text"
  • 4 ^D EOT End of Transmission indicates "end of transmission of one or more texts"
  • 11 ^K \v Vertical tab , which is for "vertical tabulation"
  • 12 ^L \f Form feed, which indicates "go to new page"

A simple proposal would be that ^A indicates a sheet name that occupies the rest of the line, and is terminated by ^B or a newline.

Alternatively, we might want to use headers to do more than just specify subsheets, for example to inline multiple text files into one (#68). This might just be a different extension, like .multi; but then we ideally need a way to put subsheets that doesn't involve a second level of ^A. One possibility is to use # for sheets:

^Aaliases.txt
A = locking 2-toggle, rotated 90, flipped
^Adrawing.asc#sheet1
  |
--A--
  |
^Adrawing.asc#sheet2
  |
--A
  |

In Vim, you can enter ^A via ^V^A. In VSCode, the insert-unicode extension seems like a decent way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions