Skip to content

Read files using CR or CRLF or just LF into elixir and treat them all the same.

License

Notifications You must be signed in to change notification settings

beatrichartz/legacy_file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LegacyFile

You have:

Files separated by CR (carriage return_), LF (line feed), or CRLF?

You want:

To read them all in and expose a stream of lines regardless.

Wait! Doesn't Elixir / Erlang support this out of the box?

No. File.Stream uses IO.each__stream which uses :io.get_line. LF and CRLF are handled, but not CR, which is used in some Mac OS and other legacy formats.

Installation

If available in Hex, the package can be installed by adding legacy_file to your list of dependencies in mix.exs:

def deps do
  [{:legacy_file, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/legacy_file.

About

Read files using CR or CRLF or just LF into elixir and treat them all the same.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published