CSV
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CSV.type
Members list
Value members
Concrete methods
Reads a CSV file from an absolute path and returns a io.github.quafadas.scautable.CsvIterator.
Reads a CSV file from an absolute path and returns a io.github.quafadas.scautable.CsvIterator.
Example:
val csv: CsvIterator[("colA", "colB", "colC")] = CSV.absolutePath("/absolute/path/to/file.csv")
Attributes
Reads a CSV from a String and returns a io.github.quafadas.scautable.CsvIterator.
Reads a CSV from a String and returns a io.github.quafadas.scautable.CsvIterator.
Example:
val csvContent = "colA,colB\n1,a\n2,b"
val csv: CsvIterator[("colA", "colB")] = CSV.fromString(csvContent)
Attributes
Creates a function that reads a CSV file from a runtime path and returns a io.github.quafadas.scautable.CsvIterator.
Creates a function that reads a CSV file from a runtime path and returns a io.github.quafadas.scautable.CsvIterator.
Unlike other CSV methods that require the file path at compile time, this method allows you to specify the column types at compile time but provide the file path at runtime. This is useful when you know the structure of a CSV file in advance but the actual file location is determined at runtime.
Example:
val csvReader = CSV.fromTyped[("name", "age", "salary"), (String, Int, Double)]
val data = csvReader(os.pwd / "employees.csv")
// data is a CsvIterator[("name", "age", "salary"), (String, Int, Double)]
Type parameters
- K
-
A tuple of string literal types representing the column names
- V
-
A tuple of types representing the column value types (must have Decoders available)
Attributes
- Returns
-
A function that takes an os.Path and returns a CsvIterator with the specified types
Reads a CSV present in the current compiler working directory resources and returns a io.github.quafadas.scautable.CsvIterator.
Reads a CSV present in the current compiler working directory resources and returns a io.github.quafadas.scautable.CsvIterator.
Note that in most cases, this is not the same as the current runtime working directory, and you are likely to get the bloop server directory.
Hopefully, useful in almond notebooks.
Example:
val csv: CsvIterator[("colA", "colB", "colC")] = CSV.pwd("file.csv")
Attributes
Reads a CSV present in java resources and returns a io.github.quafadas.scautable.CsvIterator.
Reads a CSV present in java resources and returns a io.github.quafadas.scautable.CsvIterator.
Example:
val csv: CsvIterator[("colA", "colB", "colC")] = CSV.resource("file.csv")
Attributes
Saves a URL to a local CSV returns a io.github.quafadas.scautable.CsvIterator.
Saves a URL to a local CSV returns a io.github.quafadas.scautable.CsvIterator.
Example:
val csv: CsvIterator[("colA", "colB", "colC")] = CSV.url("https://somewhere.com/file.csv")