The 2htdp/batch-io library contains the useful read-csv-file
procedure for reading a CSV file into a list. It takes a filename as its argument. Unfortunately, it does not take a string containing CSV as its argument. Suppose I have a CSV in a string variable and I want to use read-csv-file
to parse it. Is there a way to avoid saving the CSV to a file just to be able to parse the CSV?
The documentation says:
reads the standard input device (until closed) or the content of file f and produces it as a list of lists of comma-separated values.
The standard input feature could probably be exploited to achieve this, but I don't know how to proceed with this idea.