CSV

io.github.quafadas.scautable.CSV
object CSV

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
CSV.type

Members list

Value members

Concrete methods

transparent inline def absolutePath[T](path: String): CsvIterator[_ <: Tuple]

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

transparent inline def deduplicateHeaders[K <: Tuple](obj: CsvIterator[K]): CsvIterator[_ <: Tuple]

Ensures unique column names for the iterator.

Ensures unique column names for the iterator.

For each repeated column name, appends the column’s 0-based index to the name.

Example:

  val csv: CsvIterator[("colA", "colB" "colA")] = CSV.absolutePath("...")
  val uniqCsv: CsvIterator[("colA", "colB", "colA_2")] = CSV.deduplicateHeaders(csv)

Attributes

transparent inline def pwd[T](inline path: String): CsvIterator[_ <: Tuple]

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

def readCsvAbolsutePath(pathExpr: Expr[String])(using Quotes): Expr[CsvIterator[_ <: Tuple]]
transparent inline def resource[T](inline path: String): CsvIterator[_ <: Tuple]

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

transparent inline def url[T](inline path: String): CsvIterator[_ <: Tuple]

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")

Attributes

Givens

Givens

given IteratorFromExpr[K <: Tuple](using x$1: Type[K]): IteratorFromExpr[K]
given IteratorToExpr2[K <: Tuple](using x$1: ToExpr[String], x$2: Type[K]): IteratorToExpr2[K]