Delimit.FixedWidth.Writer (delimit v0.4.2)
View SourceFunctions for writing fixed-width data to files or strings.
This module handles serialization of structs into fixed-width format where each field occupies a specific number of characters.
Summary
Functions
Streams fixed-width data to a file.
Writes fixed-width data to a file.
Writes fixed-width data to a string.
Functions
@spec stream_to_file(Delimit.Schema.t(), Path.t(), Enumerable.t(), Keyword.t()) :: :ok
Streams fixed-width data to a file.
Parameters
schema- The schema definitionpath- Path to the output filedata_stream- Stream of structs to writeopts- Write options
Returns
:okon success
@spec write_file(Delimit.Schema.t(), Path.t(), [struct()], Keyword.t()) :: :ok
Writes fixed-width data to a file.
Parameters
schema- The schema definitionpath- Path to the output filedata- List of structs to writeopts- Write options
Returns
:okon success
@spec write_string(Delimit.Schema.t(), [struct()], Keyword.t()) :: binary()
Writes fixed-width data to a string.
Parameters
schema- The schema definitiondata- List of structs to writeopts- Write options (:line_ending,:headers)
Returns
- String containing the fixed-width data